<!doctype html>
<html lang="zh-CN">
<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <meta name="referrer" content="no-referrer-when-downgrade">
    

    <title>Mac配置docker开发工具 | Anttu&#39;s Blog</title>
    <meta property="og:title" content="Mac配置docker开发工具 - Anttu&#39;s Blog">
    <meta property="og:type" content="article">
        
    <meta property="article:published_time" content='2022-09-06T00:29:47&#43;08:00'>
        
        
    <meta property="article:modified_time" content='2022-09-06T00:29:47&#43;08:00'>
        
    <meta name="Keywords" content="golang,go语言,go语言笔记,anttu,java,博客,bash,linux笔记,python笔记,公众号,小程序">
    <meta name="description" content="Mac配置docker开发工具">
        
    <meta name="author" content="Anttu">
    <meta property="og:url" content="https://anttu.gitee.io/post/2022-09-06-mac_docker_dev/">
    <link rel="shortcut icon" href='/favicon.ico'  type="image/x-icon">

    <link rel="stylesheet" href='/css/normalize.css'>
    <link rel="stylesheet" href='/css/style.css'>
    <script type="text/javascript" src="//cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

    
    
    
    
    
    
        <link rel="stylesheet" href='/css/asciinema-player.css'>
    
</head>


<body>
    <header id="header" class="clearfix">
    <div class="container">
        <div class="col-group">
            <div class="site-name ">
                
                    <a id="logo" href="https://anttu.gitee.io/">
                        Anttu&#39;s Blog
                    </a>
                
                <p class="description">一位Java开发者，喜欢研究技术，同时也在学习Golang和Python中，对服务器、Linux使用比较熟悉。欢迎添加技术交流QQ群：655158296</p>
            </div>
            <div>
                <nav id="nav-menu" class="clearfix">
                    <a class="current" href="https://anttu.gitee.io/">首页</a>
                    
                    <a  href="https://anttu.gitee.io/archives/" title="归档">归档</a>
                    
                    <a  href="https://anttu.gitee.io/tags/" title="分类">分类</a>
                    
                    <a  href="https://anttu.gitee.io/about/" title="关于">关于</a>
                    
                </nav>
            </div>
        </div>
    </div>
</header>

    <div id="body">
        <div class="container">
            <div class="col-group">

                <div class="col-8" id="main">
                    
<div class="res-cons">
    <style type="text/css">
    .post-toc {
        position: fixed;
        width: 200px;
        margin-left: -210px;
        padding: 5px 10px;
        font-family: Athelas, STHeiti, Microsoft Yahei, serif;
        font-size: 12px;
        border: 1px solid rgba(0, 0, 0, .07);
        border-radius: 5px;
        background-color: rgba(255, 255, 255, 0.98);
        background-clip: padding-box;
        -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        box-shadow: 1px 1px 2px rgba(0, 0, 0, .125);
        word-wrap: break-word;
        white-space: nowrap;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
        z-index: 999;
        cursor: pointer;
        max-height: 70%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .post-toc .post-toc-title {
        width: 100%;
        margin: 0 auto;
        font-size: 20px;
        font-weight: 400;
        text-transform: uppercase;
        text-align: center;
    }

    .post-toc .post-toc-content {
        font-size: 15px;
    }

    .post-toc .post-toc-content>nav>ul {
        margin: 10px 0;
    }

    .post-toc .post-toc-content ul {
        padding-left: 20px;
        list-style: square;
        margin: 0.5em;
        line-height: 1.8em;
    }

    .post-toc .post-toc-content ul ul {
        padding-left: 15px;
        display: none;
    }

    @media print,
    screen and (max-width:1057px) {
        .post-toc {
            display: none;
        }
    }
</style>
<div class="post-toc" style="position: absolute; top: 188px;">
    <h2 class="post-toc-title">文章目录</h2>
    <div class="post-toc-content">
        <nav id="TableOfContents">
  <ul>
    <li><a href="#前言">前言</a></li>
    <li><a href="#1查询docker进程">1、查询docker进程</a></li>
    <li><a href="#2停止启动docker进程">2、停止、启动docker进程</a></li>
    <li><a href="#3启动docker">3、启动docker</a>
      <ul>
        <li></li>
      </ul>
    </li>
    <li><a href="#4docker的镜像存储位置">4、docker的镜像存储位置</a></li>
    <li><a href="#5准备环境">5、准备环境</a></li>
    <li><a href="#6准备配置文件">6、准备配置文件</a></li>
    <li><a href="#7准备脚本">7、准备脚本</a></li>
    <li><a href="#8mysql">8、mysql</a>
      <ul>
        <li><a href="#81-查询mysql镜像的所有tags">8.1 查询mysql镜像的所有tags</a></li>
        <li><a href="#82-安装mysql需要的tags">8.2 安装mysql需要的tags</a></li>
        <li><a href="#83-配置mycnf">8.3 配置my.cnf</a></li>
        <li><a href="#84-启动mysql容器">8.4 启动mysql容器</a></li>
        <li><a href="#85-停止mysql容器">8.5 停止mysql容器</a></li>
        <li><a href="#86-启动mysql容器">8.6 启动mysql容器</a></li>
        <li><a href="#87-进入mysql容器内部">8.7 进入mysql容器内部</a></li>
      </ul>
    </li>
    <li><a href="#9redis">9、redis</a>
      <ul>
        <li><a href="#91-查询redis镜像的所有tags">9.1 查询redis镜像的所有tags</a></li>
        <li><a href="#92-安装redis需要的tags">9.2 安装redis需要的tags</a></li>
        <li><a href="#93-配置redisconf">9.3 配置redis.conf</a></li>
        <li><a href="#94-启动redis容器">9.4 启动redis容器</a></li>
        <li><a href="#95-起停redis容器">9.5 起停redis容器</a></li>
        <li><a href="#96-进入redis容器内部">9.6 进入redis容器内部</a></li>
      </ul>
    </li>
    <li><a href="#10mongo">10、mongo</a>
      <ul>
        <li><a href="#101-查询mongo镜像的所有tags">10.1 查询mongo镜像的所有tags</a></li>
        <li><a href="#102-安装mongo需要的tags">10.2 安装mongo需要的tags</a></li>
        <li><a href="#103-配置mongodconf">10.3 配置mongod.conf</a></li>
        <li><a href="#104-启动mongo容器">10.4 启动mongo容器</a></li>
        <li><a href="#105-起停mongo容器">10.5 起停mongo容器</a></li>
        <li><a href="#106-进入mongo容器内部">10.6 进入mongo容器内部</a></li>
      </ul>
    </li>
    <li><a href="#11nginx">11、nginx</a>
      <ul>
        <li><a href="#111-查询nginx镜像的所有tags">11.1 查询nginx镜像的所有tags</a></li>
        <li><a href="#112-安装nginx需要的tags">11.2 安装nginx需要的tags</a></li>
        <li><a href="#113-配置conf">11.3 配置conf</a></li>
        <li><a href="#114-启动nginx容器">11.4 启动nginx容器</a></li>
        <li><a href="#115-起停nginx容器">11.5 起停nginx容器</a></li>
        <li><a href="#116-进入nginx容器内部">11.6 进入nginx容器内部</a></li>
      </ul>
    </li>
    <li><a href="#12minio">12、minio</a>
      <ul>
        <li><a href="#121-安装minio需要的tags">12.1 安装minio需要的tags</a></li>
        <li><a href="#122-启动minio容器">12.2 启动minio容器</a></li>
        <li><a href="#123-启停minio容器">12.3 启停minio容器</a></li>
        <li><a href="#124-进入minio控制台">12.4 进入minio控制台</a></li>
      </ul>
    </li>
    <li><a href="#13etcd">13、etcd</a>
      <ul>
        <li><a href="#131-安装etcd需要的tags">13.1 安装etcd需要的tags</a></li>
        <li><a href="#132-启动etcd容器">13.2 启动etcd容器</a></li>
        <li><a href="#133-启停etcd容器">13.3 启停etcd容器</a></li>
        <li><a href="#134-进入etcd容器内部">13.4 进入etcd容器内部</a></li>
      </ul>
    </li>
    <li><a href="#14结语">14、结语</a>
      <ul>
        <li><a href="#141-最后环境准备好了运行信息如下">14.1 最后环境准备好了，运行信息如下</a></li>
        <li><a href="#142-停止容器">14.2 停止容器</a></li>
        <li><a href="#143-启动脚本如下">14.3 启动脚本如下</a></li>
      </ul>
    </li>
  </ul>
</nav>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {
        var postToc = $(".post-toc");
        if (postToc.length) {
            var leftPos = $("#main").offset().left;
            if (leftPos < 220) {
                postToc.css({ "width": leftPos - 10, "margin-left": (0 - leftPos) })
            }

            var t = postToc.offset().top - 20,
                a = {
                    start: {
                        position: "absolute",
                        top: t
                    },
                    process: {
                        position: "fixed",
                        top: 20
                    },
                };
            $(window).scroll(function () {
                var e = $(window).scrollTop();
                e < t ? postToc.css(a.start) : postToc.css(a.process)
            })
        }

        if ($("#TableOfContents").children().length < 1) {
            $(".post-toc").remove();
        }
    })
</script>
    <article class="post">
        <header>
            <h1 class="post-title">Mac配置docker开发工具</h1>
        </header>
        <date class="post-meta meta-date">
            2022年9月6日
        </date>
        
        <div class="post-meta">
            <span>|</span>
            
            <span class="meta-category">
                <a href='/categories/docker' target="_blank">docker</a>
            </span>
            
            <span class="meta-category">
                <a href='/categories/mac' target="_blank">mac</a>
            </span>
            
        </div>
        
        
        <div class="post-meta">
            <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span>
                    阅读</span></span>
        </div>
        
        
        <div class="clear" style="display: none">
            <div class="toc-article">
                <div class="toc-title">文章目录</div>
            </div>
        </div>
        
        <div class="post-content">
            <h2 id="前言">前言</h2>
<p>2020年整了一套android下的termux开发环境，今天继续配置一套docker下的开发环境。<a href="/post/2020-09-28-android_termux">termux搭建参考</a></p>
<p>开发电脑环境准备如下：</p>
<table>
<thead>
<tr>
<th>系统</th>
<th>版本</th>
</tr>
</thead>
<tbody>
<tr>
<td>MacOS</td>
<td>10.14.6</td>
</tr>
<tr>
<td>docker</td>
<td>20.10.12</td>
</tr>
</tbody>
</table>
<p>待安装的开发工具环境如下：</p>
<table>
<thead>
<tr>
<th>镜像</th>
<th>版本</th>
</tr>
</thead>
<tbody>
<tr>
<td>mongo</td>
<td>6.0</td>
</tr>
<tr>
<td>redis</td>
<td>7.0</td>
</tr>
<tr>
<td>mysql</td>
<td>8.0</td>
</tr>
<tr>
<td>nginx</td>
<td>1.22.0</td>
</tr>
<tr>
<td>minio</td>
<td>latest</td>
</tr>
<tr>
<td>etcd</td>
<td>latest</td>
</tr>
</tbody>
</table>
<h2 id="1查询docker进程">1、查询docker进程</h2>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>launchctl list | grep docker
</span></span><span style="display:flex;"><span>-	0	com.docker.helper
</span></span><span style="display:flex;"><span>14047	0	com.docker.docker.47840
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="2停止启动docker进程">2、停止、启动docker进程</h2>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>launchctl stop com.docker.docker.47840 <span style="color:#000;font-weight:bold">&amp;&amp;</span> launchctl start com.docker.docker.47840
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="3启动docker">3、启动docker</h2>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>open /Applications/Docker.app
</span></span></code></pre></td></tr></table>
</div>
</div><h4 id="ps">PS:</h4>
<blockquote>
<p>目前通过 open /Applications/Docker.app 可以启动，通过 launchctl start com.docker.docker.xxx 方式不能启动了。</p>
<p>测试环境信息如下:</p>
<table>
<thead>
<tr>
<th>系统</th>
<th>版本</th>
</tr>
</thead>
<tbody>
<tr>
<td>MacOS</td>
<td>10.14.6</td>
</tr>
<tr>
<td>docker</td>
<td>20.10.12</td>
</tr>
</tbody>
</table>
<p>测试时间: 2022-09-06</p>
</blockquote>
<h2 id="4docker的镜像存储位置">4、docker的镜像存储位置</h2>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>Windows:
</span></span><span style="display:flex;"><span>打开docker desktop界面设置，
</span></span><span style="display:flex;"><span>Settings -&gt; Resources -&gt; Advanced -&gt; Disk image location
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Linux:
</span></span><span style="display:flex;"><span><span style="color:#0086b3">cd</span> /var/lib/docker - 容器与镜像存放在此目录下
</span></span><span style="display:flex;"><span>镜像位置: /var/lib/docker/image
</span></span><span style="display:flex;"><span>容器位置: /var/lib/docker/containers
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>MacOS:
</span></span><span style="display:flex;"><span>容器和镜像在如下目录下,不同版本或许可能文件版本不一样
</span></span><span style="display:flex;"><span>/Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Library/Containers/com.docker.docker/Data
</span></span><span style="display:flex;"><span>可以到上面的目录中，查看文件大小, du -sh *
</span></span><span style="display:flex;"><span>本机存放位置如下
</span></span><span style="display:flex;"><span>/Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="5准备环境">5、准备环境</h2>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">35
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#998;font-style:italic"># docker script</span>
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/shell
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># mysql</span>
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/config
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/data
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/log
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># redis</span>
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/redis
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/redis/config
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/redis/data
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/redis/log
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># mongo</span>
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongo
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongo/config
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongo/data
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongo/log
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># nginx</span>
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/nginx
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/nginx/conf
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/nginx/conf.d
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongo/log
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongo/html
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongo/cert
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># minio</span>
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/minio
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/minio/config
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/minio/data
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># etcd</span>
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/etcd
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/etcd/conf
</span></span><span style="display:flex;"><span>mkdir -p /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/etcd/data
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 复制时区文件，解决mysql镜像容器运行时区是0问题</span>
</span></span><span style="display:flex;"><span>cp /etc/localtime /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="6准备配置文件">6、准备配置文件</h2>
<p>1、my.cnf直接参考步骤9创建并写入关键参数配置<br>
<a href="#jump10">步骤10</a><br>
2、下载redis.7版本包，提取redis.conf，然后参考步骤16修改配置<br>
<a href="#jump17">步骤17</a><br>
3、mongod.conf直接参考步骤22创建并写入关键参数配置<br>
<a href="#jump23">步骤23</a><br>
4、nginx.conf直接参考步骤29创建并写入关键参数配置<br>
<a href="#jump29">步骤29</a></p>
<h2 id="7准备脚本">7、准备脚本</h2>
<p>docker-show-repo-tag.sh</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">33
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 用镜像v2接口进行解析，需要安装bash的json库</span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 安装支持bash的json库-jq</span>
</span></span><span style="display:flex;"><span>brew install jq
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 脚本内容如下：</span>
</span></span><span style="display:flex;"><span><span style="color:#008080">repo_url</span><span style="color:#000;font-weight:bold">=</span>https://registry.hub.docker.com/v2/repositories/library
</span></span><span style="display:flex;"><span><span style="color:#008080">image_name</span><span style="color:#000;font-weight:bold">=</span><span style="color:#008080">$1</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>curl -L -s <span style="color:#d14">${</span><span style="color:#008080">repo_url</span><span style="color:#d14">}</span>/<span style="color:#d14">${</span><span style="color:#008080">image_name</span><span style="color:#d14">}</span>/tags?page_size<span style="color:#000;font-weight:bold">=</span><span style="color:#099">1024</span> | jq <span style="color:#d14">&#39;.results[][&#34;name&#34;]&#39;</span> | sed <span style="color:#d14">&#39;s/\&#34;//g&#39;</span> | sort -u
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 下面步骤中提到的脚本也可以搜集整理在这里，其他脚本</span>
</span></span><span style="display:flex;"><span>ls -lar
</span></span><span style="display:flex;"><span>total <span style="color:#099">120</span>
</span></span><span style="display:flex;"><span>-rwx------@  <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">314</span>  <span style="color:#099">9</span>  <span style="color:#099">6</span> 16:27 docker-show-repo-tag.sh
</span></span><span style="display:flex;"><span>-rwx------@  <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">406</span>  <span style="color:#099">9</span>  <span style="color:#099">6</span> 20:35 docker-redis-7.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------@  <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">469</span>  <span style="color:#099">9</span>  <span style="color:#099">7</span> 00:58 docker-mongo-6.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------@  <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">357</span>  <span style="color:#099">9</span>  <span style="color:#099">7</span> 11:39 docker-start-container.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">149</span>  <span style="color:#099">9</span>  <span style="color:#099">8</span> 18:02 docker-python-demo-v1.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">147</span>  <span style="color:#099">9</span>  <span style="color:#099">8</span> 18:04 docker-nodejs-demo-v1.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">145</span>  <span style="color:#099">9</span>  <span style="color:#099">8</span> 18:08 docker-java-demo-v1.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">146</span>  <span style="color:#099">9</span>  <span style="color:#099">9</span> 14:29 docker-go-demo-v1.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">180</span>  <span style="color:#099">9</span> <span style="color:#099">20</span> 14:55 docker-getting-started-laster-run.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">557</span>  <span style="color:#099">9</span> <span style="color:#099">27</span> 21:48 demo.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">548</span>  <span style="color:#099">9</span> <span style="color:#099">28</span> 11:29 docker-nginx-1.22.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------@  <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">590</span>  <span style="color:#099">9</span> <span style="color:#099">29</span> 19:26 docker-mysql-8.0-run.sh
</span></span><span style="display:flex;"><span>-rwx------@  <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">356</span>  <span style="color:#099">9</span> <span style="color:#099">30</span> 17:02 docker-stop-container.sh
</span></span><span style="display:flex;"><span>-rwx------   <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">347</span> <span style="color:#099">10</span>  <span style="color:#099">2</span> 18:02 docker-minio-latest-run.sh
</span></span><span style="display:flex;"><span>-rwx------@  <span style="color:#099">1</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">550</span> <span style="color:#099">10</span>  <span style="color:#099">2</span> 19:09 docker-etcd-latest-run.sh
</span></span><span style="display:flex;"><span>drwxr-xr-x  <span style="color:#099">10</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">320</span> <span style="color:#099">10</span>  <span style="color:#099">2</span> 16:20 ..
</span></span><span style="display:flex;"><span>drwxr-xr-x  <span style="color:#099">17</span> <span style="color:#0086b3">test</span>  staff  <span style="color:#099">544</span> <span style="color:#099">10</span>  <span style="color:#099">2</span> 19:12 .
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 给700权限</span>
</span></span><span style="display:flex;"><span>chmod <span style="color:#099">700</span> *.sh
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="8mysql">8、mysql</h2>
<h3 id="81-查询mysql镜像的所有tags">8.1 查询mysql镜像的所有tags</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 46
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 47
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 48
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 49
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 50
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 51
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 52
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 53
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 54
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 55
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 56
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 57
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 58
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 59
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 60
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 61
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 62
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 63
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 64
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 65
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 66
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 67
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 68
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 69
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 70
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 71
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 72
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 73
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 74
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 75
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 76
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 77
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 78
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 79
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 80
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 81
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 82
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 83
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 84
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 85
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 86
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 87
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 88
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 89
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 90
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 91
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 92
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 93
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 94
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 95
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 96
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 97
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 98
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 99
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">100
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">101
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">102
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#0086b3">cd</span> /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/shell
</span></span><span style="display:flex;"><span>./docker-show-repo-tag.sh mysql
</span></span><span style="display:flex;"><span><span style="color:#099">5</span>
</span></span><span style="display:flex;"><span>5-debian
</span></span><span style="display:flex;"><span>5-oracle
</span></span><span style="display:flex;"><span>5.5
</span></span><span style="display:flex;"><span>5.5.55
</span></span><span style="display:flex;"><span>5.5.56
</span></span><span style="display:flex;"><span>5.5.57
</span></span><span style="display:flex;"><span>5.5.58
</span></span><span style="display:flex;"><span>5.5.59
</span></span><span style="display:flex;"><span>5.5.60
</span></span><span style="display:flex;"><span>5.5.61
</span></span><span style="display:flex;"><span>5.5.62
</span></span><span style="display:flex;"><span>5.6
</span></span><span style="display:flex;"><span>5.6.36
</span></span><span style="display:flex;"><span>5.6.37
</span></span><span style="display:flex;"><span>5.6.38
</span></span><span style="display:flex;"><span>5.6.39
</span></span><span style="display:flex;"><span>5.6.40
</span></span><span style="display:flex;"><span>5.6.41
</span></span><span style="display:flex;"><span>5.6.42
</span></span><span style="display:flex;"><span>5.6.43
</span></span><span style="display:flex;"><span>5.6.44
</span></span><span style="display:flex;"><span>5.6.45
</span></span><span style="display:flex;"><span>5.6.46
</span></span><span style="display:flex;"><span>5.6.47
</span></span><span style="display:flex;"><span>5.6.48
</span></span><span style="display:flex;"><span>5.6.49
</span></span><span style="display:flex;"><span>5.6.50
</span></span><span style="display:flex;"><span>5.6.51
</span></span><span style="display:flex;"><span>5.7
</span></span><span style="display:flex;"><span>5.7-debian
</span></span><span style="display:flex;"><span>5.7-oracle
</span></span><span style="display:flex;"><span>5.7.18
</span></span><span style="display:flex;"><span>5.7.19
</span></span><span style="display:flex;"><span>5.7.20
</span></span><span style="display:flex;"><span>5.7.21
</span></span><span style="display:flex;"><span>5.7.22
</span></span><span style="display:flex;"><span>5.7.23
</span></span><span style="display:flex;"><span>5.7.24
</span></span><span style="display:flex;"><span>5.7.25
</span></span><span style="display:flex;"><span>5.7.26
</span></span><span style="display:flex;"><span>5.7.27
</span></span><span style="display:flex;"><span>5.7.28
</span></span><span style="display:flex;"><span>5.7.29
</span></span><span style="display:flex;"><span>5.7.30
</span></span><span style="display:flex;"><span>5.7.31
</span></span><span style="display:flex;"><span>5.7.32
</span></span><span style="display:flex;"><span>5.7.33
</span></span><span style="display:flex;"><span>5.7.34
</span></span><span style="display:flex;"><span>5.7.35
</span></span><span style="display:flex;"><span>5.7.36
</span></span><span style="display:flex;"><span>5.7.37
</span></span><span style="display:flex;"><span>5.7.37-debian
</span></span><span style="display:flex;"><span>5.7.37-oracle
</span></span><span style="display:flex;"><span>5.7.38
</span></span><span style="display:flex;"><span>5.7.38-debian
</span></span><span style="display:flex;"><span>5.7.38-oracle
</span></span><span style="display:flex;"><span>5.7.39
</span></span><span style="display:flex;"><span>5.7.39-debian
</span></span><span style="display:flex;"><span>5.7.39-oracle
</span></span><span style="display:flex;"><span><span style="color:#099">8</span>
</span></span><span style="display:flex;"><span>8-debian
</span></span><span style="display:flex;"><span>8-oracle
</span></span><span style="display:flex;"><span>8.0
</span></span><span style="display:flex;"><span>8.0-debian
</span></span><span style="display:flex;"><span>8.0-oracle
</span></span><span style="display:flex;"><span>8.0.1
</span></span><span style="display:flex;"><span>8.0.11
</span></span><span style="display:flex;"><span>8.0.12
</span></span><span style="display:flex;"><span>8.0.13
</span></span><span style="display:flex;"><span>8.0.14
</span></span><span style="display:flex;"><span>8.0.15
</span></span><span style="display:flex;"><span>8.0.16
</span></span><span style="display:flex;"><span>8.0.17
</span></span><span style="display:flex;"><span>8.0.18
</span></span><span style="display:flex;"><span>8.0.19
</span></span><span style="display:flex;"><span>8.0.2
</span></span><span style="display:flex;"><span>8.0.20
</span></span><span style="display:flex;"><span>8.0.21
</span></span><span style="display:flex;"><span>8.0.22
</span></span><span style="display:flex;"><span>8.0.23
</span></span><span style="display:flex;"><span>8.0.24
</span></span><span style="display:flex;"><span>8.0.25
</span></span><span style="display:flex;"><span>8.0.26
</span></span><span style="display:flex;"><span>8.0.27
</span></span><span style="display:flex;"><span>8.0.28
</span></span><span style="display:flex;"><span>8.0.28-debian
</span></span><span style="display:flex;"><span>8.0.28-oracle
</span></span><span style="display:flex;"><span>8.0.29
</span></span><span style="display:flex;"><span>8.0.29-debian
</span></span><span style="display:flex;"><span>8.0.29-oracle
</span></span><span style="display:flex;"><span>8.0.3
</span></span><span style="display:flex;"><span>8.0.30
</span></span><span style="display:flex;"><span>8.0.30-debian
</span></span><span style="display:flex;"><span>8.0.30-oracle
</span></span><span style="display:flex;"><span>8.0.4
</span></span><span style="display:flex;"><span>8.0.4-rc
</span></span><span style="display:flex;"><span>debian
</span></span><span style="display:flex;"><span>latest
</span></span><span style="display:flex;"><span>oracle
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="82-安装mysql需要的tags">8.2 安装mysql需要的tags</h3>
<p>以mysql 8.0举例</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker pull mysql:8.0
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="83-配置mycnf">8.3 配置my.cnf</h3>
<p><span id="jump10">my.cnf</span></p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span>client<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>default-character-set<span style="color:#000;font-weight:bold">=</span>utf8mb4
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span>mysqld<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span><span style="color:#008080">user</span><span style="color:#000;font-weight:bold">=</span>mysql
</span></span><span style="display:flex;"><span>character-set-server<span style="color:#000;font-weight:bold">=</span>utf8mb4
</span></span><span style="display:flex;"><span><span style="color:#008080">default_authentication_plugin</span><span style="color:#000;font-weight:bold">=</span>mysql_native_password
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="84-启动mysql容器">8.4 启动mysql容器</h3>
<p>提前准备一些参数</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker run <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-d <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 3306:3306 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--name mysql8 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--network bridge <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--restart always <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--privileged<span style="color:#000;font-weight:bold">=</span><span style="color:#0086b3">true</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/config/my.cnf:/etc/mysql/my.cnf <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/data:/var/lib/mysql <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/log:/logs <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mysql/localtime:/etc/localtime <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">MYSQL_ROOT_PASSWORD</span><span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#34;root123456&#34;</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">MYSQL_USER</span><span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#34;mysql&#34;</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">MYSQL_PASSWORD</span><span style="color:#000;font-weight:bold">=</span><span style="color:#d14">&#34;test123456&#34;</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e character-set-server<span style="color:#000;font-weight:bold">=</span>utf8 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e collation-server<span style="color:#000;font-weight:bold">=</span>utf8_general_ci <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>mysql:8.0
</span></span></code></pre></td></tr></table>
</div>
</div><p>参数说明：</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>-d</td>
<td>后台运行容器</td>
</tr>
<tr>
<td>-p</td>
<td>将容器的3306端口映射到主机的3306端口</td>
</tr>
<tr>
<td>&ndash;name</td>
<td>MySQL容器名称</td>
</tr>
<tr>
<td>&ndash;network</td>
<td>网络</td>
</tr>
<tr>
<td>–-restart always</td>
<td>开机启动</td>
</tr>
<tr>
<td>–-privileged=true</td>
<td>提升容器内权限（false可能会因权限导致无法启动）</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/mysql/config/my.cnf:/etc/mysql/my.cnf</td>
<td>映射my.cnf</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/mysql/data:/var/lib/mysql</td>
<td>映射data目录</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/mysql/log:/logs</td>
<td>映射logs目录</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/mysql/localtime:/etc/localtime</td>
<td>映射时区，解决容器mysql是0时区问题</td>
</tr>
<tr>
<td>-e</td>
<td>设置环境变量:<br>MYSQL_USER：添加用户<br>MYSQL_PASSWORD：设置添加用户密码<br>MYSQL_ROOT_PASSWORD：设置root用户密码<br>character-set-server：设置字符集<br>collation-server：设置字符比较规则<br></td>
</tr>
<tr>
<td>mysql:8.0</td>
<td>mysql(repository) : 8.0(tag)</td>
</tr>
</tbody>
</table>
<h3 id="85-停止mysql容器">8.5 停止mysql容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS          PORTS                               NAMES
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">25</span> minutes ago   Up <span style="color:#099">25</span> minutes   0.0.0.0:3306-&gt;3306/tcp, 33060/tcp   mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">6</span> hours ago      Up <span style="color:#099">6</span> hours      0.0.0.0:80-&gt;80/tcp                  crazy_chatterjee
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker stop b055811ce23c
</span></span><span style="display:flex;"><span>b055811ce23c
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="86-启动mysql容器">8.6 启动mysql容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS                     PORTS                NAMES
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">29</span> minutes ago   Exited <span style="color:#000;font-weight:bold">(</span>0<span style="color:#000;font-weight:bold">)</span> <span style="color:#099">3</span> minutes ago                        mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">6</span> hours ago      Up <span style="color:#099">6</span> hours                 0.0.0.0:80-&gt;80/tcp   crazy_chatterjee
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker start b055811ce23c
</span></span><span style="display:flex;"><span>b055811ce23c
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="87-进入mysql容器内部">8.7 进入mysql容器内部</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">35
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED          STATUS          PORTS                               NAMES
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">41</span> minutes ago   Up <span style="color:#099">10</span> minutes   0.0.0.0:3306-&gt;3306/tcp, 33060/tcp   mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">6</span> hours ago      Up <span style="color:#099">6</span> hours      0.0.0.0:80-&gt;80/tcp                  crazy_chatterjee
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker <span style="color:#0086b3">exec</span> -it b055811ce23c /bin/bash
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>bash-4.4# <span style="color:#0086b3">echo</span> <span style="color:#008080">$PATH</span>
</span></span><span style="display:flex;"><span>/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
</span></span><span style="display:flex;"><span>bash-4.4# mysql -uroot -proot123456
</span></span><span style="display:flex;"><span>mysql: <span style="color:#000;font-weight:bold">[</span>Warning<span style="color:#000;font-weight:bold">]</span> Using a password on the <span style="color:#0086b3">command</span> line interface can be insecure.
</span></span><span style="display:flex;"><span>Welcome to the MySQL monitor.  Commands end with ; or <span style="color:#d14">\g</span>.
</span></span><span style="display:flex;"><span>Your MySQL connection id is <span style="color:#099">9</span>
</span></span><span style="display:flex;"><span>Server version: 8.0.30 MySQL Community Server - GPL
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Copyright <span style="color:#000;font-weight:bold">(</span>c<span style="color:#000;font-weight:bold">)</span> 2000, 2022, Oracle and/or its affiliates.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Oracle is a registered trademark of Oracle Corporation and/or its
</span></span><span style="display:flex;"><span>affiliates. Other names may be trademarks of their respective
</span></span><span style="display:flex;"><span>owners.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Type <span style="color:#d14">&#39;help;&#39;</span> or <span style="color:#d14">&#39;\h&#39;</span> <span style="color:#000;font-weight:bold">for</span> help. Type <span style="color:#d14">&#39;\c&#39;</span> to clear the current input statement.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>mysql&gt; show databases;
</span></span><span style="display:flex;"><span>+--------------------+
</span></span><span style="display:flex;"><span>| Database           |
</span></span><span style="display:flex;"><span>+--------------------+
</span></span><span style="display:flex;"><span>| information_schema |
</span></span><span style="display:flex;"><span>| mysql              |
</span></span><span style="display:flex;"><span>| performance_schema |
</span></span><span style="display:flex;"><span>| sys                |
</span></span><span style="display:flex;"><span>+--------------------+
</span></span><span style="display:flex;"><span><span style="color:#099">4</span> rows in <span style="color:#0086b3">set</span> <span style="color:#000;font-weight:bold">(</span>0.01 sec<span style="color:#000;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>mysql&gt;
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="9redis">9、redis</h2>
<h3 id="91-查询redis镜像的所有tags">9.1 查询redis镜像的所有tags</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 46
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 47
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 48
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 49
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 50
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 51
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 52
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 53
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 54
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 55
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 56
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 57
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 58
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 59
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 60
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 61
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 62
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 63
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 64
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 65
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 66
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 67
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 68
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 69
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 70
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 71
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 72
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 73
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 74
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 75
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 76
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 77
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 78
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 79
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 80
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 81
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 82
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 83
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 84
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 85
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 86
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 87
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 88
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 89
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 90
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 91
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 92
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 93
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 94
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 95
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 96
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 97
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 98
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 99
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">100
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">101
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">102
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#0086b3">cd</span> /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/shell
</span></span><span style="display:flex;"><span>./docker-show-repo-tag.sh redis
</span></span><span style="display:flex;"><span><span style="color:#099">5</span>
</span></span><span style="display:flex;"><span>5-32bit
</span></span><span style="display:flex;"><span>5-32bit-bullseye
</span></span><span style="display:flex;"><span>5-alpine
</span></span><span style="display:flex;"><span>5-alpine3.15
</span></span><span style="display:flex;"><span>5-alpine3.16
</span></span><span style="display:flex;"><span>5-bullseye
</span></span><span style="display:flex;"><span>5.0
</span></span><span style="display:flex;"><span>5.0-32bit
</span></span><span style="display:flex;"><span>5.0-32bit-bullseye
</span></span><span style="display:flex;"><span>5.0-alpine
</span></span><span style="display:flex;"><span>5.0-alpine3.15
</span></span><span style="display:flex;"><span>5.0-alpine3.16
</span></span><span style="display:flex;"><span>5.0-bullseye
</span></span><span style="display:flex;"><span>5.0.14
</span></span><span style="display:flex;"><span>5.0.14-32bit
</span></span><span style="display:flex;"><span>5.0.14-32bit-bullseye
</span></span><span style="display:flex;"><span>5.0.14-alpine
</span></span><span style="display:flex;"><span>5.0.14-alpine3.15
</span></span><span style="display:flex;"><span>5.0.14-alpine3.16
</span></span><span style="display:flex;"><span>5.0.14-bullseye
</span></span><span style="display:flex;"><span><span style="color:#099">6</span>
</span></span><span style="display:flex;"><span>6-alpine
</span></span><span style="display:flex;"><span>6-alpine3.15
</span></span><span style="display:flex;"><span>6-alpine3.16
</span></span><span style="display:flex;"><span>6-bullseye
</span></span><span style="display:flex;"><span>6.0
</span></span><span style="display:flex;"><span>6.0-alpine
</span></span><span style="display:flex;"><span>6.0-alpine3.15
</span></span><span style="display:flex;"><span>6.0-alpine3.16
</span></span><span style="display:flex;"><span>6.0-bullseye
</span></span><span style="display:flex;"><span>6.0.16
</span></span><span style="display:flex;"><span>6.0.16-alpine
</span></span><span style="display:flex;"><span>6.0.16-alpine3.15
</span></span><span style="display:flex;"><span>6.0.16-alpine3.16
</span></span><span style="display:flex;"><span>6.0.16-bullseye
</span></span><span style="display:flex;"><span>6.2
</span></span><span style="display:flex;"><span>6.2-alpine
</span></span><span style="display:flex;"><span>6.2-alpine3.15
</span></span><span style="display:flex;"><span>6.2-alpine3.16
</span></span><span style="display:flex;"><span>6.2-bullseye
</span></span><span style="display:flex;"><span>6.2.6
</span></span><span style="display:flex;"><span>6.2.6-alpine
</span></span><span style="display:flex;"><span>6.2.6-alpine3.15
</span></span><span style="display:flex;"><span>6.2.6-bullseye
</span></span><span style="display:flex;"><span>6.2.7
</span></span><span style="display:flex;"><span>6.2.7-alpine
</span></span><span style="display:flex;"><span>6.2.7-alpine3.15
</span></span><span style="display:flex;"><span>6.2.7-alpine3.16
</span></span><span style="display:flex;"><span>6.2.7-bullseye
</span></span><span style="display:flex;"><span><span style="color:#099">7</span>
</span></span><span style="display:flex;"><span>7-alpine
</span></span><span style="display:flex;"><span>7-alpine3.15
</span></span><span style="display:flex;"><span>7-alpine3.16
</span></span><span style="display:flex;"><span>7-bullseye
</span></span><span style="display:flex;"><span>7.0
</span></span><span style="display:flex;"><span>7.0-alpine
</span></span><span style="display:flex;"><span>7.0-alpine3.15
</span></span><span style="display:flex;"><span>7.0-alpine3.16
</span></span><span style="display:flex;"><span>7.0-bullseye
</span></span><span style="display:flex;"><span>7.0-rc
</span></span><span style="display:flex;"><span>7.0-rc-alpine
</span></span><span style="display:flex;"><span>7.0-rc-alpine3.15
</span></span><span style="display:flex;"><span>7.0-rc-bullseye
</span></span><span style="display:flex;"><span>7.0-rc1
</span></span><span style="display:flex;"><span>7.0-rc1-bullseye
</span></span><span style="display:flex;"><span>7.0-rc2
</span></span><span style="display:flex;"><span>7.0-rc2-alpine
</span></span><span style="display:flex;"><span>7.0-rc2-alpine3.15
</span></span><span style="display:flex;"><span>7.0-rc2-bullseye
</span></span><span style="display:flex;"><span>7.0-rc3
</span></span><span style="display:flex;"><span>7.0-rc3-alpine
</span></span><span style="display:flex;"><span>7.0-rc3-alpine3.15
</span></span><span style="display:flex;"><span>7.0-rc3-bullseye
</span></span><span style="display:flex;"><span>7.0.0
</span></span><span style="display:flex;"><span>7.0.0-alpine
</span></span><span style="display:flex;"><span>7.0.0-alpine3.15
</span></span><span style="display:flex;"><span>7.0.0-alpine3.16
</span></span><span style="display:flex;"><span>7.0.0-bullseye
</span></span><span style="display:flex;"><span>7.0.1
</span></span><span style="display:flex;"><span>7.0.1-alpine
</span></span><span style="display:flex;"><span>7.0.1-alpine3.16
</span></span><span style="display:flex;"><span>7.0.1-bullseye
</span></span><span style="display:flex;"><span>7.0.2
</span></span><span style="display:flex;"><span>7.0.2-alpine
</span></span><span style="display:flex;"><span>7.0.2-alpine3.16
</span></span><span style="display:flex;"><span>7.0.2-bullseye
</span></span><span style="display:flex;"><span>7.0.3
</span></span><span style="display:flex;"><span>7.0.3-alpine
</span></span><span style="display:flex;"><span>7.0.3-alpine3.16
</span></span><span style="display:flex;"><span>7.0.3-bullseye
</span></span><span style="display:flex;"><span>7.0.4
</span></span><span style="display:flex;"><span>7.0.4-alpine
</span></span><span style="display:flex;"><span>7.0.4-alpine3.16
</span></span><span style="display:flex;"><span>7.0.4-bullseye
</span></span><span style="display:flex;"><span>alpine
</span></span><span style="display:flex;"><span>alpine3.15
</span></span><span style="display:flex;"><span>alpine3.16
</span></span><span style="display:flex;"><span>bullseye
</span></span><span style="display:flex;"><span>latest
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="92-安装redis需要的tags">9.2 安装redis需要的tags</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker pull redis:7.0
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="93-配置redisconf">9.3 配置redis.conf</h3>
<p><span id="jump17">redis.conf</span></p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#998;font-style:italic">#bind 127.0.0.1             #注释掉这部分,使redis可以外部访问</span>
</span></span><span style="display:flex;"><span>protected-mode no           <span style="color:#998;font-style:italic">#修改为no,去掉保护模式,让外网可以访问</span>
</span></span><span style="display:flex;"><span>daemonize no                <span style="color:#998;font-style:italic">#修改为no,不用守护线程的方式启动</span>
</span></span><span style="display:flex;"><span>requirepass test123456      <span style="color:#998;font-style:italic">#密码</span>
</span></span><span style="display:flex;"><span>appendonly yes              <span style="color:#998;font-style:italic">#redis持久化,默认是no</span>
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="94-启动redis容器">9.4 启动redis容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker run <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-d <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 6379:6379 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--name redis7 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--network bridge <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--restart<span style="color:#000;font-weight:bold">=</span>always <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--privileged<span style="color:#000;font-weight:bold">=</span><span style="color:#0086b3">true</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--log-opt max-size<span style="color:#000;font-weight:bold">=</span>100m <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--log-opt max-file<span style="color:#000;font-weight:bold">=</span><span style="color:#099">2</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/redis/config/redis.conf:/etc/redis/redis.conf <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/redis/data:/data <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>redis:7.0 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>redis-server /etc/redis/redis.conf <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--appendonly yes <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--requirepass test123456
</span></span></code></pre></td></tr></table>
</div>
</div><p>参数说明：</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>-d</td>
<td>后台运行容器</td>
</tr>
<tr>
<td>-p 6379:6379</td>
<td>把容器内的6379端口映射到宿主机6379端口</td>
</tr>
<tr>
<td>&ndash;name</td>
<td>redis容器名称</td>
</tr>
<tr>
<td>&ndash;network</td>
<td>网络</td>
</tr>
<tr>
<td>–-restart always</td>
<td>开机启动</td>
</tr>
<tr>
<td>–-privileged=true</td>
<td>提升容器内权限（false可能会因权限导致无法启动）</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/redis/config/redis.conf:/etc/redis/redis.conf</td>
<td>将到宿主机的文件/Users/{whoami}/Downloads/Docker/redis/config/redis.conf 作为redis容器的配置文件/etc/redis/redis.conf</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/redis/data:/data</td>
<td>把redis持久化的数据放在宿主机目录/mydata/redis/data中，做数据备份</td>
</tr>
<tr>
<td>redis-server /etc/redis/redis.conf</td>
<td>这个是关键配置，让redis不是无配置启动，而是按照这个redis.conf的配置启动</td>
</tr>
<tr>
<td>–-appendonly yes</td>
<td>redis启动后数据持久化</td>
</tr>
<tr>
<td>&ndash;requirepass test123456</td>
<td>redis的密码</td>
</tr>
<tr>
<td>redis:7.0</td>
<td>redis(repository) : 7.0(tag)</td>
</tr>
</tbody>
</table>
<h4 id="ps-1">PS:</h4>
<blockquote>
<p>经测试，redis:7.0不能放在结尾，需要在 redis-server 命令之前，否着启动会报错</p>
</blockquote>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>Unable to find image <span style="color:#d14">&#39;redis-server:latest&#39;</span> locally
</span></span><span style="display:flex;"><span>docker: Error response from daemon: pull access denied <span style="color:#000;font-weight:bold">for</span> redis-server, repository does not exist or may require <span style="color:#d14">&#39;docker login&#39;</span>: denied: requested access to the resource is denied.
</span></span><span style="display:flex;"><span>See <span style="color:#d14">&#39;docker run --help&#39;</span>.
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="95-起停redis容器">9.5 起停redis容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS         PORTS                               NAMES
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">8</span> minutes ago   Up <span style="color:#099">7</span> minutes   0.0.0.0:6379-&gt;6379/tcp              redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">4</span> hours ago     Up <span style="color:#099">3</span> hours     0.0.0.0:3306-&gt;3306/tcp, 33060/tcp   mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">9</span> hours ago     Up <span style="color:#099">9</span> hours     0.0.0.0:80-&gt;80/tcp                  crazy_chatterjee
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker stop e7bbf340c66c
</span></span><span style="display:flex;"><span>e7bbf340c66c
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker start e7bbf340c66c
</span></span><span style="display:flex;"><span>e7bbf340c66c
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="96-进入redis容器内部">9.6 进入redis容器内部</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">8
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker <span style="color:#0086b3">exec</span> -it e7bbf340c66c /bin/bash
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>root@e7bbf340c66c:/data# redis-cli
</span></span><span style="display:flex;"><span>127.0.0.1:6379&gt; auth test123456
</span></span><span style="display:flex;"><span>OK
</span></span><span style="display:flex;"><span>127.0.0.1:6379&gt; get <span style="color:#099">123</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">(</span>nil<span style="color:#000;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span>127.0.0.1:6379&gt;
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="10mongo">10、mongo</h2>
<h3 id="101-查询mongo镜像的所有tags">10.1 查询mongo镜像的所有tags</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 46
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 47
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 48
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 49
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 50
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 51
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 52
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 53
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 54
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 55
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 56
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 57
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 58
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 59
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 60
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 61
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 62
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 63
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 64
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 65
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 66
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 67
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 68
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 69
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 70
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 71
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 72
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 73
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 74
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 75
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 76
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 77
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 78
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 79
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 80
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 81
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 82
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 83
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 84
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 85
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 86
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 87
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 88
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 89
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 90
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 91
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 92
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 93
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 94
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 95
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 96
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 97
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 98
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 99
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">100
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">101
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>./docker-show-repo-tag.sh mongo
</span></span><span style="display:flex;"><span><span style="color:#099">4</span>
</span></span><span style="display:flex;"><span>4-focal
</span></span><span style="display:flex;"><span>4.0
</span></span><span style="display:flex;"><span>4.0-xenial
</span></span><span style="display:flex;"><span>4.0.28
</span></span><span style="display:flex;"><span>4.0.28-xenial
</span></span><span style="display:flex;"><span>4.2
</span></span><span style="display:flex;"><span>4.2-bionic
</span></span><span style="display:flex;"><span>4.2-rc
</span></span><span style="display:flex;"><span>4.2-rc-bionic
</span></span><span style="display:flex;"><span>4.2-rc-nanoserver
</span></span><span style="display:flex;"><span>4.2-rc-nanoserver-1809
</span></span><span style="display:flex;"><span>4.2-rc-nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>4.2-rc-windowsservercore
</span></span><span style="display:flex;"><span>4.2-rc-windowsservercore-1809
</span></span><span style="display:flex;"><span>4.2-rc-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>4.2.22
</span></span><span style="display:flex;"><span>4.2.22-bionic
</span></span><span style="display:flex;"><span>4.2.22-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>4.2.23-rc0
</span></span><span style="display:flex;"><span>4.2.23-rc0-bionic
</span></span><span style="display:flex;"><span>4.2.23-rc0-nanoserver
</span></span><span style="display:flex;"><span>4.2.23-rc0-nanoserver-1809
</span></span><span style="display:flex;"><span>4.2.23-rc0-nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>4.2.23-rc0-windowsservercore
</span></span><span style="display:flex;"><span>4.2.23-rc0-windowsservercore-1809
</span></span><span style="display:flex;"><span>4.2.23-rc0-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>4.4
</span></span><span style="display:flex;"><span>4.4-focal
</span></span><span style="display:flex;"><span>4.4-rc
</span></span><span style="display:flex;"><span>4.4-rc-focal
</span></span><span style="display:flex;"><span>4.4-rc-nanoserver
</span></span><span style="display:flex;"><span>4.4-rc-nanoserver-1809
</span></span><span style="display:flex;"><span>4.4-rc-nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>4.4-rc-windowsservercore
</span></span><span style="display:flex;"><span>4.4-rc-windowsservercore-1809
</span></span><span style="display:flex;"><span>4.4-rc-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>4.4-windowsservercore
</span></span><span style="display:flex;"><span>4.4-windowsservercore-1809
</span></span><span style="display:flex;"><span>4.4-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>4.4.16
</span></span><span style="display:flex;"><span>4.4.16-focal
</span></span><span style="display:flex;"><span>4.4.16-windowsservercore
</span></span><span style="display:flex;"><span>4.4.16-windowsservercore-1809
</span></span><span style="display:flex;"><span>4.4.16-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>4.4.17-rc0
</span></span><span style="display:flex;"><span>4.4.17-rc0-focal
</span></span><span style="display:flex;"><span>4.4.17-rc0-nanoserver
</span></span><span style="display:flex;"><span>4.4.17-rc0-nanoserver-1809
</span></span><span style="display:flex;"><span>4.4.17-rc0-nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>4.4.17-rc0-windowsservercore
</span></span><span style="display:flex;"><span>4.4.17-rc0-windowsservercore-1809
</span></span><span style="display:flex;"><span>4.4.17-rc0-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span><span style="color:#099">5</span>
</span></span><span style="display:flex;"><span>5-focal
</span></span><span style="display:flex;"><span>5-windowsservercore
</span></span><span style="display:flex;"><span>5-windowsservercore-1809
</span></span><span style="display:flex;"><span>5-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>5.0
</span></span><span style="display:flex;"><span>5.0-focal
</span></span><span style="display:flex;"><span>5.0-windowsservercore
</span></span><span style="display:flex;"><span>5.0-windowsservercore-1809
</span></span><span style="display:flex;"><span>5.0-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>5.0.11
</span></span><span style="display:flex;"><span>5.0.11-focal
</span></span><span style="display:flex;"><span>5.0.11-windowsservercore
</span></span><span style="display:flex;"><span>5.0.11-windowsservercore-1809
</span></span><span style="display:flex;"><span>5.0.11-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span><span style="color:#099">6</span>
</span></span><span style="display:flex;"><span>6-focal
</span></span><span style="display:flex;"><span>6-nanoserver
</span></span><span style="display:flex;"><span>6-nanoserver-1809
</span></span><span style="display:flex;"><span>6-nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>6-windowsservercore
</span></span><span style="display:flex;"><span>6-windowsservercore-1809
</span></span><span style="display:flex;"><span>6-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>6.0
</span></span><span style="display:flex;"><span>6.0-focal
</span></span><span style="display:flex;"><span>6.0-nanoserver
</span></span><span style="display:flex;"><span>6.0-nanoserver-1809
</span></span><span style="display:flex;"><span>6.0-nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>6.0-windowsservercore
</span></span><span style="display:flex;"><span>6.0-windowsservercore-1809
</span></span><span style="display:flex;"><span>6.0-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>6.0.1
</span></span><span style="display:flex;"><span>6.0.1-focal
</span></span><span style="display:flex;"><span>6.0.1-nanoserver
</span></span><span style="display:flex;"><span>6.0.1-nanoserver-1809
</span></span><span style="display:flex;"><span>6.0.1-nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>6.0.1-windowsservercore
</span></span><span style="display:flex;"><span>6.0.1-windowsservercore-1809
</span></span><span style="display:flex;"><span>6.0.1-windowsservercore-ltsc2022
</span></span><span style="display:flex;"><span>focal
</span></span><span style="display:flex;"><span>latest
</span></span><span style="display:flex;"><span>nanoserver
</span></span><span style="display:flex;"><span>nanoserver-1809
</span></span><span style="display:flex;"><span>nanoserver-ltsc2022
</span></span><span style="display:flex;"><span>windowsservercore
</span></span><span style="display:flex;"><span>windowsservercore-1809
</span></span><span style="display:flex;"><span>windowsservercore-ltsc2022
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="102-安装mongo需要的tags">10.2 安装mongo需要的tags</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker pull mongo:6.0
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="103-配置mongodconf">10.3 配置mongod.conf</h3>
<p><span id="jump23">mongod.conf</span></p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-yaml" data-lang="yaml"><span style="display:flex;"><span><span style="color:#000080">systemLog</span>:<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">destination</span>:<span style="color:#bbb"> </span>file<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">logAppend</span>:<span style="color:#bbb"> </span><span style="color:#000;font-weight:bold">true</span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">path</span>:<span style="color:#bbb"> </span>/data/logs/mongodb.log<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#000080">storage</span>:<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">dbPath</span>:<span style="color:#bbb"> </span>/data/db<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">journal</span>:<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">        </span><span style="color:#000080">enabled</span>:<span style="color:#bbb"> </span><span style="color:#000;font-weight:bold">true</span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#000080">processManagement</span>:<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">fork</span>:<span style="color:#bbb"> </span><span style="color:#000;font-weight:bold">false</span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">timeZoneInfo</span>:<span style="color:#bbb"> </span>/usr/share/zoneinfo<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#000080">net</span>:<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">port</span>:<span style="color:#bbb"> </span><span style="color:#099">27017</span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">bindIp</span>:<span style="color:#bbb"> </span><span style="color:#099">0.0.0.0</span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb"></span><span style="color:#000080">security</span>:<span style="color:#bbb">
</span></span></span><span style="display:flex;"><span><span style="color:#bbb">    </span><span style="color:#000080">authorization</span>:<span style="color:#bbb"> </span>enabled<span style="color:#bbb">
</span></span></span></code></pre></td></tr></table>
</div>
</div><h3 id="104-启动mongo容器">10.4 启动mongo容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker run <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-d <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 27017:27017 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--name mongo6 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--network bridge <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--restart<span style="color:#000;font-weight:bold">=</span>always <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--privileged<span style="color:#000;font-weight:bold">=</span><span style="color:#0086b3">true</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">MONGO_INITDB_ROOT_USERNAME</span><span style="color:#000;font-weight:bold">=</span>admin <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">MONGO_INITDB_ROOT_PASSWORD</span><span style="color:#000;font-weight:bold">=</span>admin123456 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">TZ</span><span style="color:#000;font-weight:bold">=</span>Asia/Shanghai <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongodb/data:/data/db <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongodb/config:/data/mongo/conf <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#000;font-weight:bold">{</span>whoami<span style="color:#000;font-weight:bold">}</span>/Downloads/Docker/mongodb/log:/data/logs <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>mongo:6.0 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-f /data/mongo/conf/mongod.conf
</span></span></code></pre></td></tr></table>
</div>
</div><p>参数说明：</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>-d</td>
<td>后台运行容器</td>
</tr>
<tr>
<td>-p 27017:27017</td>
<td>把容器内的27017端口映射到宿主机27017端口</td>
</tr>
<tr>
<td>&ndash;name</td>
<td>mongodb容器名称</td>
</tr>
<tr>
<td>&ndash;network</td>
<td>网络</td>
</tr>
<tr>
<td>–-restart always</td>
<td>开机启动</td>
</tr>
<tr>
<td>–-privileged=true</td>
<td>提升容器内权限（false可能会因权限导致无法启动）</td>
</tr>
<tr>
<td>-e MONGO_INITDB_ROOT_USERNAME</td>
<td>root账号</td>
</tr>
<tr>
<td>-e MONGO_INITDB_ROOT_PASSWORD</td>
<td>root密码</td>
</tr>
<tr>
<td>-e TZ=Asia/Shanghai</td>
<td>时区指定shanghai(上海)</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/mongodb/data:/data/db</td>
<td>映射/data/db</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/mongodb/config:/data/mongo/conf</td>
<td>映射/data/mongo/conf</td>
</tr>
<tr>
<td>-v /Users/{whoami}/Downloads/Docker/mongodb/log:/data/log</td>
<td>映射/data/log</td>
</tr>
<tr>
<td>-f /data/mongo/conf/mongod.conf</td>
<td>启动mongo并加载指定配置文件</td>
</tr>
<tr>
<td>mongo:6.0</td>
<td>mongo(repository) : 6.0(tag)</td>
</tr>
</tbody>
</table>
<h3 id="105-起停mongo容器">10.5 起停mongo容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED         STATUS         PORTS                               NAMES
</span></span><span style="display:flex;"><span>5d3e522b6295   mongo:6.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">8</span> seconds ago   Up <span style="color:#099">7</span> seconds   0.0.0.0:27017-&gt;27017/tcp            mongo6
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">4</span> hours ago     Up <span style="color:#099">4</span> hours     0.0.0.0:6379-&gt;6379/tcp              redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">8</span> hours ago     Up <span style="color:#099">7</span> hours     0.0.0.0:3306-&gt;3306/tcp, 33060/tcp   mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">13</span> hours ago    Up <span style="color:#099">13</span> hours    0.0.0.0:80-&gt;80/tcp                  crazy_chatterjee
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker stop 5d3e522b6295
</span></span><span style="display:flex;"><span>5d3e522b6295
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker start 5d3e522b6295
</span></span><span style="display:flex;"><span>5d3e522b6295
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="106-进入mongo容器内部">10.6 进入mongo容器内部</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">34
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker <span style="color:#0086b3">exec</span> -it 5d3e522b6295 /bin/bash
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>root@5d3e522b6295:/# ./bin/mongosh
</span></span><span style="display:flex;"><span>Current Mongosh Log ID:	63177d5eaf46621a26b4d4a0
</span></span><span style="display:flex;"><span>Connecting to:		mongodb://127.0.0.1:27017/?directConnection<span style="color:#000;font-weight:bold">=</span>true&amp;<span style="color:#008080">serverSelectionTimeoutMS</span><span style="color:#000;font-weight:bold">=</span>2000&amp;<span style="color:#008080">appName</span><span style="color:#000;font-weight:bold">=</span>mongosh+1.5.4
</span></span><span style="display:flex;"><span>Using MongoDB:		6.0.1
</span></span><span style="display:flex;"><span>Using Mongosh:		1.5.4
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>For mongosh info see: https://docs.mongodb.com/mongodb-shell/
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>To <span style="color:#0086b3">help</span> improve our products, anonymous usage data is collected and sent to MongoDB periodically <span style="color:#000;font-weight:bold">(</span>https://www.mongodb.com/legal/privacy-policy<span style="color:#000;font-weight:bold">)</span>.
</span></span><span style="display:flex;"><span>You can opt-out by running the disableTelemetry<span style="color:#000;font-weight:bold">()</span> command.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>test&gt; use admin
</span></span><span style="display:flex;"><span>switched to db admin
</span></span><span style="display:flex;"><span>admin&gt; db.auth<span style="color:#000;font-weight:bold">(</span><span style="color:#d14">&#39;admin&#39;</span>, <span style="color:#d14">&#39;admin123456&#39;</span><span style="color:#000;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span> ok: <span style="color:#099">1</span> <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>admin&gt; show users
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">[</span>
</span></span><span style="display:flex;"><span>  <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    _id: <span style="color:#d14">&#39;admin.admin&#39;</span>,
</span></span><span style="display:flex;"><span>    userId: UUID<span style="color:#000;font-weight:bold">(</span><span style="color:#d14">&#34;e0536aa2-8b49-4050-acea-0f86413f9711&#34;</span><span style="color:#000;font-weight:bold">)</span>,
</span></span><span style="display:flex;"><span>    user: <span style="color:#d14">&#39;admin&#39;</span>,
</span></span><span style="display:flex;"><span>    db: <span style="color:#d14">&#39;admin&#39;</span>,
</span></span><span style="display:flex;"><span>    roles: <span style="color:#000;font-weight:bold">[</span> <span style="color:#000;font-weight:bold">{</span> role: <span style="color:#d14">&#39;root&#39;</span>, db: <span style="color:#d14">&#39;admin&#39;</span> <span style="color:#000;font-weight:bold">}</span> <span style="color:#000;font-weight:bold">]</span>,
</span></span><span style="display:flex;"><span>    mechanisms: <span style="color:#000;font-weight:bold">[</span> <span style="color:#d14">&#39;SCRAM-SHA-1&#39;</span>, <span style="color:#d14">&#39;SCRAM-SHA-256&#39;</span> <span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>  <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>admin&gt; show dbs
</span></span><span style="display:flex;"><span>admin   100.00 KiB
</span></span><span style="display:flex;"><span>config   12.00 KiB
</span></span><span style="display:flex;"><span><span style="color:#0086b3">local</span>    72.00 KiB
</span></span><span style="display:flex;"><span>admin&gt;
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="11nginx">11、nginx</h2>
<h3 id="111-查询nginx镜像的所有tags">11.1 查询nginx镜像的所有tags</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 46
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 47
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 48
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 49
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 50
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 51
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 52
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 53
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 54
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 55
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 56
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 57
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 58
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 59
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 60
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 61
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 62
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 63
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 64
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 65
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 66
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 67
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 68
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 69
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 70
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 71
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 72
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 73
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 74
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 75
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 76
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 77
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 78
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 79
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 80
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 81
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 82
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 83
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 84
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 85
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 86
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 87
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 88
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 89
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 90
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 91
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 92
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 93
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 94
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 95
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 96
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 97
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 98
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 99
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">100
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">101
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>./docker-show-repo-tag.sh nginx
</span></span><span style="display:flex;"><span><span style="color:#099">1</span>
</span></span><span style="display:flex;"><span>1-alpine
</span></span><span style="display:flex;"><span>1-alpine-perl
</span></span><span style="display:flex;"><span>1-perl
</span></span><span style="display:flex;"><span>1.18
</span></span><span style="display:flex;"><span>1.18-alpine
</span></span><span style="display:flex;"><span>1.18-alpine-perl
</span></span><span style="display:flex;"><span>1.18-perl
</span></span><span style="display:flex;"><span>1.18.0
</span></span><span style="display:flex;"><span>1.18.0-alpine
</span></span><span style="display:flex;"><span>1.18.0-alpine-perl
</span></span><span style="display:flex;"><span>1.18.0-perl
</span></span><span style="display:flex;"><span>1.19
</span></span><span style="display:flex;"><span>1.19-alpine
</span></span><span style="display:flex;"><span>1.19-alpine-perl
</span></span><span style="display:flex;"><span>1.19-perl
</span></span><span style="display:flex;"><span>1.19.10
</span></span><span style="display:flex;"><span>1.19.10-alpine
</span></span><span style="display:flex;"><span>1.19.10-alpine-perl
</span></span><span style="display:flex;"><span>1.19.10-perl
</span></span><span style="display:flex;"><span>1.19.9
</span></span><span style="display:flex;"><span>1.19.9-alpine
</span></span><span style="display:flex;"><span>1.19.9-alpine-perl
</span></span><span style="display:flex;"><span>1.19.9-perl
</span></span><span style="display:flex;"><span>1.20
</span></span><span style="display:flex;"><span>1.20-alpine
</span></span><span style="display:flex;"><span>1.20-alpine-perl
</span></span><span style="display:flex;"><span>1.20-perl
</span></span><span style="display:flex;"><span>1.20.0
</span></span><span style="display:flex;"><span>1.20.0-alpine
</span></span><span style="display:flex;"><span>1.20.0-alpine-perl
</span></span><span style="display:flex;"><span>1.20.0-perl
</span></span><span style="display:flex;"><span>1.20.1
</span></span><span style="display:flex;"><span>1.20.1-alpine
</span></span><span style="display:flex;"><span>1.20.1-alpine-perl
</span></span><span style="display:flex;"><span>1.20.1-perl
</span></span><span style="display:flex;"><span>1.20.2
</span></span><span style="display:flex;"><span>1.20.2-alpine
</span></span><span style="display:flex;"><span>1.20.2-alpine-perl
</span></span><span style="display:flex;"><span>1.20.2-perl
</span></span><span style="display:flex;"><span>1.21
</span></span><span style="display:flex;"><span>1.21-alpine
</span></span><span style="display:flex;"><span>1.21-alpine-perl
</span></span><span style="display:flex;"><span>1.21-perl
</span></span><span style="display:flex;"><span>1.21.0
</span></span><span style="display:flex;"><span>1.21.0-alpine
</span></span><span style="display:flex;"><span>1.21.0-alpine-perl
</span></span><span style="display:flex;"><span>1.21.0-perl
</span></span><span style="display:flex;"><span>1.21.1
</span></span><span style="display:flex;"><span>1.21.1-alpine
</span></span><span style="display:flex;"><span>1.21.1-alpine-perl
</span></span><span style="display:flex;"><span>1.21.1-perl
</span></span><span style="display:flex;"><span>1.21.3
</span></span><span style="display:flex;"><span>1.21.3-alpine
</span></span><span style="display:flex;"><span>1.21.3-alpine-perl
</span></span><span style="display:flex;"><span>1.21.3-perl
</span></span><span style="display:flex;"><span>1.21.4
</span></span><span style="display:flex;"><span>1.21.4-alpine
</span></span><span style="display:flex;"><span>1.21.4-alpine-perl
</span></span><span style="display:flex;"><span>1.21.4-perl
</span></span><span style="display:flex;"><span>1.21.5
</span></span><span style="display:flex;"><span>1.21.5-alpine
</span></span><span style="display:flex;"><span>1.21.5-alpine-perl
</span></span><span style="display:flex;"><span>1.21.5-perl
</span></span><span style="display:flex;"><span>1.21.6
</span></span><span style="display:flex;"><span>1.21.6-alpine
</span></span><span style="display:flex;"><span>1.21.6-alpine-perl
</span></span><span style="display:flex;"><span>1.21.6-perl
</span></span><span style="display:flex;"><span>1.22
</span></span><span style="display:flex;"><span>1.22-alpine
</span></span><span style="display:flex;"><span>1.22-alpine-perl
</span></span><span style="display:flex;"><span>1.22-perl
</span></span><span style="display:flex;"><span>1.22.0
</span></span><span style="display:flex;"><span>1.22.0-alpine
</span></span><span style="display:flex;"><span>1.22.0-alpine-perl
</span></span><span style="display:flex;"><span>1.22.0-perl
</span></span><span style="display:flex;"><span>1.23
</span></span><span style="display:flex;"><span>1.23-alpine
</span></span><span style="display:flex;"><span>1.23-alpine-perl
</span></span><span style="display:flex;"><span>1.23-perl
</span></span><span style="display:flex;"><span>1.23.0
</span></span><span style="display:flex;"><span>1.23.0-alpine
</span></span><span style="display:flex;"><span>1.23.0-alpine-perl
</span></span><span style="display:flex;"><span>1.23.0-perl
</span></span><span style="display:flex;"><span>1.23.1
</span></span><span style="display:flex;"><span>1.23.1-alpine
</span></span><span style="display:flex;"><span>1.23.1-alpine-perl
</span></span><span style="display:flex;"><span>1.23.1-perl
</span></span><span style="display:flex;"><span>alpine
</span></span><span style="display:flex;"><span>alpine-perl
</span></span><span style="display:flex;"><span>latest
</span></span><span style="display:flex;"><span>mainline
</span></span><span style="display:flex;"><span>mainline-alpine
</span></span><span style="display:flex;"><span>mainline-alpine-perl
</span></span><span style="display:flex;"><span>mainline-perl
</span></span><span style="display:flex;"><span>perl
</span></span><span style="display:flex;"><span>stable
</span></span><span style="display:flex;"><span>stable-alpine
</span></span><span style="display:flex;"><span>stable-alpine-perl
</span></span><span style="display:flex;"><span>stable-perl
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="112-安装nginx需要的tags">11.2 安装nginx需要的tags</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker pull nginx:1.22.0
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="113-配置conf">11.3 配置conf</h3>
<p><span id="jump29">nginx.conf</span></p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 46
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 47
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 48
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 49
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 50
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 51
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 52
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 53
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 54
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 55
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 56
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 57
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 58
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 59
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 60
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 61
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 62
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 63
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 64
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 65
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 66
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 67
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 68
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 69
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 70
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 71
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 72
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 73
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 74
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 75
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 76
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 77
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 78
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 79
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 80
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 81
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 82
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 83
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 84
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 85
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 86
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 87
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 88
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 89
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 90
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 91
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 92
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 93
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 94
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 95
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 96
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 97
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 98
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 99
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">100
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">101
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">102
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">103
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">104
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">105
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">106
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">107
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">108
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">109
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">110
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">111
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">112
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">113
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">114
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">115
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">116
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">117
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">118
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#998;font-style:italic">#user  nobody;</span>
</span></span><span style="display:flex;"><span>worker_processes  1;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#error_log  logs/error.log;</span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#error_log  logs/error.log  notice;</span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#error_log  logs/error.log  info;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#pid        logs/nginx.pid;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>events <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    worker_connections  1024;
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>http <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    include       mime.types;
</span></span><span style="display:flex;"><span>    default_type  application/octet-stream;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#log_format  main  &#39;$remote_addr - $remote_user [$time_local] &#34;$request&#34; &#39;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#                  &#39;$status $body_bytes_sent &#34;$http_referer&#34; &#39;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#                  &#39;&#34;$http_user_agent&#34; &#34;$http_x_forwarded_for&#34;&#39;;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#access_log  logs/access.log  main;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    sendfile        on;
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#tcp_nopush     on;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#keepalive_timeout  0;</span>
</span></span><span style="display:flex;"><span>    keepalive_timeout  65;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#gzip  on;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    server <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>        listen       80;
</span></span><span style="display:flex;"><span>        server_name  localhost;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        charset utf-8;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#access_log  logs/host.access.log  main;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        location / <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>            root   html;
</span></span><span style="display:flex;"><span>            index  index.html index.htm;
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        error_page  <span style="color:#099">404</span>              /404.html;
</span></span><span style="display:flex;"><span>        error_page  <span style="color:#099">500</span>              /500.html;
</span></span><span style="display:flex;"><span>        error_page  <span style="color:#099">502</span> <span style="color:#099">503</span> <span style="color:#099">504</span>      /error.html;
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># redirect server error pages to the static page /50x.html</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#error_page   500 502 503 504  /50x.html;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#008080">location</span> <span style="color:#000;font-weight:bold">=</span> /50x.html <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>            root   html;
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># proxy the PHP scripts to Apache listening on 127.0.0.1:80</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#location ~ \.php$ {</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    proxy_pass   http://127.0.0.1;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#location ~ \.php$ {</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    root           html;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    fastcgi_pass   127.0.0.1:9000;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    fastcgi_index  index.php;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    include        fastcgi_params;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># deny access to .htaccess files, if Apache&#39;s document root</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># concurs with nginx&#39;s one</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#location ~ /\.ht {</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    deny  all;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic"># another virtual host using mix of IP-, name-, and port-based configuration</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#server {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    listen       8000;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    listen       somename:8080;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    server_name  somename  alias  another.alias;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    location / {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        root   html;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        index  index.html index.htm;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    }</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic"># HTTPS server</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#server {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    listen       443 ssl;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    server_name  localhost;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_certificate      cert.pem;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_certificate_key  cert.key;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_session_cache    shared:SSL:1m;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_session_timeout  5m;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_ciphers  HIGH:!aNULL:!MD5;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_prefer_server_ciphers  on;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    location / {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        root   html;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        index  index.html index.htm;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    }</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    include conf.d/*.conf;
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span>
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="114-启动nginx容器">11.4 启动nginx容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker run <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-d <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 80:80 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 443:443 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--name nginx1.22.0 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--network bridge <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--restart<span style="color:#000;font-weight:bold">=</span>always <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--privileged<span style="color:#000;font-weight:bold">=</span><span style="color:#0086b3">true</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#d14">${</span><span style="color:#008080">whoami</span><span style="color:#d14">}</span>/Downloads/Docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#d14">${</span><span style="color:#008080">whoami</span><span style="color:#d14">}</span>/Downloads/Docker/nginx/conf.d:/etc/nginx/conf.d <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#d14">${</span><span style="color:#008080">whoami</span><span style="color:#d14">}</span>/Downloads/Docker/nginx/cert:/etc/nginx/certs <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#d14">${</span><span style="color:#008080">whoami</span><span style="color:#d14">}</span>/Downloads/Docker/nginx/html:/etc/nginx/html <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#d14">${</span><span style="color:#008080">whoami</span><span style="color:#d14">}</span>/Downloads/Docker/nginx/log:/var/log/nginx <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">LANG</span><span style="color:#000;font-weight:bold">=</span>C.UTF-8 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#008080">LC_ALL</span><span style="color:#000;font-weight:bold">=</span>C.UTF-8 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>nginx:1.22.0
</span></span></code></pre></td></tr></table>
</div>
</div><p>参数说明：</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>-d</td>
<td>后台运行容器</td>
</tr>
<tr>
<td>-p 80:80<br>-p 443:443</td>
<td>把容器内的80端口、443端口分别映射到宿主机80端口、443端口</td>
</tr>
<tr>
<td>&ndash;name</td>
<td>nginx容器名称</td>
</tr>
<tr>
<td>&ndash;network</td>
<td>网络</td>
</tr>
<tr>
<td>–-restart always</td>
<td>开机启动</td>
</tr>
<tr>
<td>–-privileged=true</td>
<td>提升容器内权限（false可能会因权限导致无法启动）</td>
</tr>
<tr>
<td>-v /Users/${whoami}/Downloads/Docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf</td>
<td>nginx的主配置文件</td>
</tr>
<tr>
<td>-v /Users/${whoami}/Downloads/Docker/nginx/conf.d:/etc/nginx/conf.d</td>
<td>nginx的自定义配置文件目录，该目录下所有的*.conf会生效</td>
</tr>
<tr>
<td>-v /Users/${whoami}/Downloads/Docker/nginx/cert:/etc/nginx/certs</td>
<td>nginx的ssl证书</td>
</tr>
<tr>
<td>-v /Users/${whoami}/Downloads/Docker/nginx/html:/etc/nginx/html</td>
<td>nginx的静态文件</td>
</tr>
<tr>
<td>-v /Users/${whoami}/Downloads/Docker/nginx/log:/var/log/nginx</td>
<td>nginx的日志目录</td>
</tr>
<tr>
<td>-e LANG=C.UTF-8</td>
<td>解决nginx中文乱码</td>
</tr>
<tr>
<td>-e LC_ALL=C.UTF-8</td>
<td>解决nginx中文乱码</td>
</tr>
<tr>
<td>nginx:1.22.0</td>
<td>nginx(repository) : 1.22.0(tag)</td>
</tr>
</tbody>
</table>
<h3 id="115-起停nginx容器">11.5 起停nginx容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED       STATUS                     PORTS                                      NAMES
</span></span><span style="display:flex;"><span>46b779b40bb5   nginx:1.22.0             <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">3</span> days ago    Up <span style="color:#099">19</span> seconds              0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp   nginx1.22.0
</span></span><span style="display:flex;"><span>83c107ac3c1b   docker-gs-ping:v1.0      <span style="color:#d14">&#34;/docker-gs-ping&#34;</span>        <span style="color:#099">8</span> days ago    Up <span style="color:#099">19</span> seconds              0.0.0.0:8081-&gt;8081/tcp                     go-docker-v1
</span></span><span style="display:flex;"><span>170ce646f5cd   java-docker:v1.0         <span style="color:#d14">&#34;./mvnw spring-boot:…&#34;</span>   <span style="color:#099">9</span> days ago    Up <span style="color:#099">19</span> seconds              0.0.0.0:8080-&gt;8080/tcp                     java-docker-v1
</span></span><span style="display:flex;"><span>439741b1c983   node-docker:v1.0         <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">9</span> days ago    Up <span style="color:#099">18</span> seconds              0.0.0.0:8000-&gt;8000/tcp                     nodejs-docker-v1
</span></span><span style="display:flex;"><span>77c73cd73550   python-docker:v1.0       <span style="color:#d14">&#34;python3 -m flask ru…&#34;</span>   <span style="color:#099">9</span> days ago    Up <span style="color:#099">19</span> seconds              0.0.0.0:5000-&gt;5000/tcp                     python-docker-v1
</span></span><span style="display:flex;"><span>5d3e522b6295   mongo:6.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">10</span> days ago   Up <span style="color:#099">18</span> seconds              0.0.0.0:27017-&gt;27017/tcp                   mongo6
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">10</span> days ago   Up <span style="color:#099">19</span> seconds              0.0.0.0:6379-&gt;6379/tcp                     redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">11</span> days ago   Up <span style="color:#099">18</span> seconds              0.0.0.0:3306-&gt;3306/tcp, 33060/tcp          mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">11</span> days ago   Exited <span style="color:#000;font-weight:bold">(</span>255<span style="color:#000;font-weight:bold">)</span> <span style="color:#099">10</span> days ago   0.0.0.0:80-&gt;80/tcp                         crazy_chatterjee
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker stop 46b779b40bb5
</span></span><span style="display:flex;"><span>46b779b40bb5
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker start s46b779b40bb5
</span></span><span style="display:flex;"><span>46b779b40bb5
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="116-进入nginx容器内部">11.6 进入nginx容器内部</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">  9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 46
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 47
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 48
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 49
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 50
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 51
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 52
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 53
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 54
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 55
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 56
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 57
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 58
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 59
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 60
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 61
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 62
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 63
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 64
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 65
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 66
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 67
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 68
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 69
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 70
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 71
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 72
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 73
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 74
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 75
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 76
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 77
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 78
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 79
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 80
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 81
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 82
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 83
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 84
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 85
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 86
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 87
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 88
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 89
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 90
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 91
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 92
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 93
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 94
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 95
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 96
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 97
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 98
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 99
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">100
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">101
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">102
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">103
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">104
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">105
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">106
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">107
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">108
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">109
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">110
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">111
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">112
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">113
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">114
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">115
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">116
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">117
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">118
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">119
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">120
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">121
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">122
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">123
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">124
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">125
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker <span style="color:#0086b3">exec</span> -it 46b779b40bb5 /bin/bash
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>root@46b779b40bb5:/# ls /etc/nginx/nginx.conf
</span></span><span style="display:flex;"><span>/etc/nginx/nginx.conf
</span></span><span style="display:flex;"><span>root@46b779b40bb5:/# cat /etc/nginx/nginx.conf
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#user  nobody;</span>
</span></span><span style="display:flex;"><span>worker_processes  1;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#error_log  logs/error.log;</span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#error_log  logs/error.log  notice;</span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#error_log  logs/error.log  info;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic">#pid        logs/nginx.pid;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>events <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    worker_connections  1024;
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>http <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    include       mime.types;
</span></span><span style="display:flex;"><span>    default_type  application/octet-stream;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#log_format  main  &#39;$remote_addr - $remote_user [$time_local] &#34;$request&#34; &#39;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#                  &#39;$status $body_bytes_sent &#34;$http_referer&#34; &#39;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#                  &#39;&#34;$http_user_agent&#34; &#34;$http_x_forwarded_for&#34;&#39;;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#access_log  logs/access.log  main;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    sendfile        on;
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#tcp_nopush     on;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#keepalive_timeout  0;</span>
</span></span><span style="display:flex;"><span>    keepalive_timeout  65;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#gzip  on;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    server <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>        listen       80;
</span></span><span style="display:flex;"><span>        server_name  localhost;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        charset utf-8;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#access_log  logs/host.access.log  main;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        location / <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>            root   html;
</span></span><span style="display:flex;"><span>            index  index.html index.htm;
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        error_page  <span style="color:#099">404</span>              /404.html;
</span></span><span style="display:flex;"><span>        error_page  <span style="color:#099">500</span>              /500.html;
</span></span><span style="display:flex;"><span>        error_page  <span style="color:#099">502</span> <span style="color:#099">503</span> <span style="color:#099">504</span>      /error.html;
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># redirect server error pages to the static page /50x.html</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#error_page   500 502 503 504  /50x.html;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#008080">location</span> <span style="color:#000;font-weight:bold">=</span> /50x.html <span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>            root   html;
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># proxy the PHP scripts to Apache listening on 127.0.0.1:80</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#location ~ \.php$ {</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    proxy_pass   http://127.0.0.1;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#location ~ \.php$ {</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    root           html;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    fastcgi_pass   127.0.0.1:9000;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    fastcgi_index  index.php;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    include        fastcgi_params;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># deny access to .htaccess files, if Apache&#39;s document root</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># concurs with nginx&#39;s one</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#location ~ /\.ht {</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#    deny  all;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic"># another virtual host using mix of IP-, name-, and port-based configuration</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#server {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    listen       8000;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    listen       somename:8080;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    server_name  somename  alias  another.alias;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    location / {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        root   html;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        index  index.html index.htm;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    }</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic"># HTTPS server</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#server {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    listen       443 ssl;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    server_name  localhost;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_certificate      cert.pem;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_certificate_key  cert.key;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_session_cache    shared:SSL:1m;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_session_timeout  5m;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_ciphers  HIGH:!aNULL:!MD5;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    ssl_prefer_server_ciphers  on;</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    location / {</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        root   html;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#        index  index.html index.htm;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#    }</span>
</span></span><span style="display:flex;"><span>    <span style="color:#998;font-style:italic">#}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    include conf.d/*.conf;
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>root@46b779b40bb5:/#
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="12minio">12、minio</h2>
<h3 id="121-安装minio需要的tags">12.1 安装minio需要的tags</h3>
<p>直接安装最新版本</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker pull quay.io/minio/minio:latest
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="122-启动minio容器">12.2 启动minio容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker run <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-d <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--network bridge <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--restart<span style="color:#000;font-weight:bold">=</span>always <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--privileged<span style="color:#000;font-weight:bold">=</span><span style="color:#0086b3">true</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 9000:9000 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 9090:9090 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--user <span style="color:#000;font-weight:bold">$(</span>id -u<span style="color:#000;font-weight:bold">)</span>:<span style="color:#000;font-weight:bold">$(</span>id -g<span style="color:#000;font-weight:bold">)</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--name minio1 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#d14">&#34;MINIO_ROOT_USER=admin&#34;</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-e <span style="color:#d14">&#34;MINIO_ROOT_PASSWORD=admin123456&#34;</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-v /Users/<span style="color:#d14">${</span><span style="color:#008080">whoami</span><span style="color:#d14">}</span>/Downloads/Docker/minio/data:/data <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>quay.io/minio/minio server /data --console-address <span style="color:#d14">&#34;:9090&#34;</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>参数说明：</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>-d</td>
<td>后台运行容器</td>
</tr>
<tr>
<td>-p 9000:9000<br>-p 9090:9090</td>
<td>把容器内的9000端口、9090端口分别映射到宿主机9000端口、9090端口</td>
</tr>
<tr>
<td>&ndash;name</td>
<td>minio容器名称</td>
</tr>
<tr>
<td>&ndash;network</td>
<td>网络</td>
</tr>
<tr>
<td>–-restart always</td>
<td>开机启动</td>
</tr>
<tr>
<td>–-privileged=true</td>
<td>提升容器内权限（false可能会因权限导致无法启动）</td>
</tr>
<tr>
<td>&ndash;user</td>
<td>设置属组权限</td>
</tr>
<tr>
<td>-e &ldquo;MINIO_ROOT_USER=admin&rdquo;</td>
<td>设置 root 账号</td>
</tr>
<tr>
<td>-e &ldquo;MINIO_ROOT_PASSWORD=admin123456&rdquo;</td>
<td>设置 root 密码</td>
</tr>
<tr>
<td>-v /Users/${whoami}/Downloads/Docker/minio/data:/data</td>
<td>绑定minio 的数据目录</td>
</tr>
<tr>
<td>&ndash;console-address &ldquo;:9090&rdquo;</td>
<td>启动参数，控制台端口9090</td>
</tr>
</tbody>
</table>
<h3 id="123-启停minio容器">12.3 启停minio容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                            NAMES
</span></span><span style="display:flex;"><span>aa0b29848539   quay.io/coreos/etcd:latest      <span style="color:#d14">&#34;/usr/local/bin/etcd…&#34;</span>   <span style="color:#099">49</span> minutes ago   Up <span style="color:#099">49</span> minutes   0.0.0.0:2379-2380-&gt;2379-2380/tcp                 etcd
</span></span><span style="display:flex;"><span>8cc751e02862   quay.io/minio/minio             <span style="color:#d14">&#34;/usr/bin/docker-ent…&#34;</span>   <span style="color:#099">2</span> hours ago      Up <span style="color:#099">2</span> hours      0.0.0.0:9000-&gt;9000/tcp, 0.0.0.0:9090-&gt;9090/tcp   minio1
</span></span><span style="display:flex;"><span>1ee4158a624a   docker/getting-started:latest   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">12</span> days ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:3000-&gt;3000/tcp, 0.0.0.0:8001-&gt;80/tcp     getting-started-latest
</span></span><span style="display:flex;"><span>46b779b40bb5   nginx:1.22.0                    <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">2</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp         nginx1.22.0
</span></span><span style="display:flex;"><span>83c107ac3c1b   docker-gs-ping:v1.0             <span style="color:#d14">&#34;/docker-gs-ping&#34;</span>        <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8081-&gt;8081/tcp                           go-docker-v1
</span></span><span style="display:flex;"><span>170ce646f5cd   java-docker:v1.0                <span style="color:#d14">&#34;./mvnw spring-boot:…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8080-&gt;8080/tcp                           java-docker-v1
</span></span><span style="display:flex;"><span>439741b1c983   node-docker:v1.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8000-&gt;8000/tcp                           nodejs-docker-v1
</span></span><span style="display:flex;"><span>77c73cd73550   python-docker:v1.0              <span style="color:#d14">&#34;python3 -m flask ru…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:5000-&gt;5000/tcp                           python-docker-v1
</span></span><span style="display:flex;"><span>5d3e522b6295   mongo:6.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:27017-&gt;27017/tcp                         mongo6
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:6379-&gt;6379/tcp                           redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:3306-&gt;3306/tcp, 33060/tcp                mysql8
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker stop 8cc751e02862
</span></span><span style="display:flex;"><span>8cc751e02862
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker start 8cc751e02862
</span></span><span style="display:flex;"><span>8cc751e02862 
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="124-进入minio控制台">12.4 进入minio控制台</h3>
<p>浏览器访问http://127.0.0.1:9090

        <img class="mx-auto" alt="" src="/posts/docker/minio_console.png" />   
    </p>
<h2 id="13etcd">13、etcd</h2>
<h3 id="131-安装etcd需要的tags">13.1 安装etcd需要的tags</h3>
<p>直接安装最新版本</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker pull quay.io/coreos/etcd:latest
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="132-启动etcd容器">13.2 启动etcd容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#008080">NODE1</span><span style="color:#000;font-weight:bold">=</span>0.0.0.0
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#008080">REGISTRY</span><span style="color:#000;font-weight:bold">=</span>quay.io/coreos/etcd
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker run <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-d <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 2379:2379 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>-p 2380:2380 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--name etcd <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--network bridge <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--restart<span style="color:#000;font-weight:bold">=</span>always <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--privileged<span style="color:#000;font-weight:bold">=</span><span style="color:#0086b3">true</span> <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--volume<span style="color:#000;font-weight:bold">=</span>/Users/<span style="color:#d14">${</span><span style="color:#008080">whoami</span><span style="color:#d14">}</span>/Downloads/Docker/etcd/data:/etcd/data <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span><span style="color:#d14">${</span><span style="color:#008080">REGISTRY</span><span style="color:#d14">}</span>:latest <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>/usr/local/bin/etcd <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--data-dir<span style="color:#000;font-weight:bold">=</span>/etcd/data --name node1 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--initial-advertise-peer-urls http://<span style="color:#d14">${</span><span style="color:#008080">NODE1</span><span style="color:#d14">}</span>:2380 --listen-peer-urls http://0.0.0.0:2380 <span style="color:#d14">\
</span></span></span><span style="display:flex;"><span><span style="color:#d14"></span>--advertise-client-urls http://<span style="color:#d14">${</span><span style="color:#008080">NODE1</span><span style="color:#d14">}</span>:2379 --listen-client-urls http://0.0.0.0:2379 <span style="color:#d14">\
</span></span></span></code></pre></td></tr></table>
</div>
</div><p>参数说明：</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>-d</td>
<td>后台运行容器</td>
</tr>
<tr>
<td>-p 2379:2379<br>-p 2380:2380</td>
<td>把容器内的2379端口、2380端口分别映射到宿主机2379端口、2380端口</td>
</tr>
<tr>
<td>&ndash;name</td>
<td>etcd容器名称</td>
</tr>
<tr>
<td>&ndash;network</td>
<td>网络</td>
</tr>
<tr>
<td>–-restart always</td>
<td>开机启动</td>
</tr>
<tr>
<td>–-privileged=true</td>
<td>提升容器内权限（false可能会因权限导致无法启动）</td>
</tr>
<tr>
<td>&ndash;volume=/Users/${whoami}/Downloads/Docker/etcd/data:/etcd/data</td>
<td>绑定数据目录</td>
</tr>
<tr>
<td>${REGISTRY}:latest</td>
<td>etcd(repository) : latest(tag)</td>
</tr>
<tr>
<td>&ndash;data-dir</td>
<td>etcd 数据目录</td>
</tr>
<tr>
<td>&ndash;name</td>
<td>etcd 名称 node1</td>
</tr>
<tr>
<td>&ndash;initial-advertise-peer-urls http://${NODE1}:2380</td>
<td>该节点同伴监听地址，这个值会告诉集群中其他节点。</td>
</tr>
<tr>
<td>&ndash;listen-peer-urls http://0.0.0.0:2380</td>
<td>和同伴通信的地址，比如http://ip:2380，如果有多个，使用逗号分隔。需要所有节点都能够访问，所以不要使用 localhost！</td>
</tr>
<tr>
<td>&ndash;advertise-client-urls http://${NODE1}:2379</td>
<td>对外公告的该节点客户端监听地址，这个值会告诉集群中其他节点。</td>
</tr>
<tr>
<td>&ndash;listen-client-urls http://0.0.0.0:2379</td>
<td>对外提供服务的地址：比如http://ip:2379,http://127.0.0.1:2379，客户端会连接到这里和 etcd 交互。</td>
</tr>
</tbody>
</table>
<h3 id="133-启停etcd容器">13.3 启停etcd容器</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                            NAMES
</span></span><span style="display:flex;"><span>aa0b29848539   quay.io/coreos/etcd:latest      <span style="color:#d14">&#34;/usr/local/bin/etcd…&#34;</span>   <span style="color:#099">49</span> minutes ago   Up <span style="color:#099">49</span> minutes   0.0.0.0:2379-2380-&gt;2379-2380/tcp                 etcd
</span></span><span style="display:flex;"><span>8cc751e02862   quay.io/minio/minio             <span style="color:#d14">&#34;/usr/bin/docker-ent…&#34;</span>   <span style="color:#099">2</span> hours ago      Up <span style="color:#099">2</span> hours      0.0.0.0:9000-&gt;9000/tcp, 0.0.0.0:9090-&gt;9090/tcp   minio1
</span></span><span style="display:flex;"><span>1ee4158a624a   docker/getting-started:latest   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">12</span> days ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:3000-&gt;3000/tcp, 0.0.0.0:8001-&gt;80/tcp     getting-started-latest
</span></span><span style="display:flex;"><span>46b779b40bb5   nginx:1.22.0                    <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">2</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp         nginx1.22.0
</span></span><span style="display:flex;"><span>83c107ac3c1b   docker-gs-ping:v1.0             <span style="color:#d14">&#34;/docker-gs-ping&#34;</span>        <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8081-&gt;8081/tcp                           go-docker-v1
</span></span><span style="display:flex;"><span>170ce646f5cd   java-docker:v1.0                <span style="color:#d14">&#34;./mvnw spring-boot:…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8080-&gt;8080/tcp                           java-docker-v1
</span></span><span style="display:flex;"><span>439741b1c983   node-docker:v1.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8000-&gt;8000/tcp                           nodejs-docker-v1
</span></span><span style="display:flex;"><span>77c73cd73550   python-docker:v1.0              <span style="color:#d14">&#34;python3 -m flask ru…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:5000-&gt;5000/tcp                           python-docker-v1
</span></span><span style="display:flex;"><span>5d3e522b6295   mongo:6.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:27017-&gt;27017/tcp                         mongo6
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:6379-&gt;6379/tcp                           redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:3306-&gt;3306/tcp, 33060/tcp                mysql8
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker stop aa0b29848539
</span></span><span style="display:flex;"><span>aa0b29848539
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker start aa0b29848539
</span></span><span style="display:flex;"><span>aa0b29848539 
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="134-进入etcd容器内部">13.4 进入etcd容器内部</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">7
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>docker <span style="color:#0086b3">exec</span> -it etcd bin/sh
</span></span><span style="display:flex;"><span>/ <span style="color:#998;font-style:italic"># etcdctl member list</span>
</span></span><span style="display:flex;"><span>1c70f9bbb41018f: <span style="color:#008080">name</span><span style="color:#000;font-weight:bold">=</span>node1 <span style="color:#008080">peerURLs</span><span style="color:#000;font-weight:bold">=</span>http://0.0.0.0:2380 <span style="color:#008080">clientURLs</span><span style="color:#000;font-weight:bold">=</span>http://0.0.0.0:2379 <span style="color:#008080">isLeader</span><span style="color:#000;font-weight:bold">=</span><span style="color:#0086b3">true</span>
</span></span><span style="display:flex;"><span>/ <span style="color:#998;font-style:italic"># etcdctl list</span>
</span></span><span style="display:flex;"><span>No <span style="color:#0086b3">help</span> topic <span style="color:#000;font-weight:bold">for</span> <span style="color:#d14">&#39;list&#39;</span>
</span></span><span style="display:flex;"><span>/ <span style="color:#998;font-style:italic"># etcdctl ls</span>
</span></span><span style="display:flex;"><span>/ <span style="color:#998;font-style:italic">#</span>
</span></span></code></pre></td></tr></table>
</div>
</div><h2 id="14结语">14、结语</h2>
<h3 id="141-最后环境准备好了运行信息如下">14.1 最后环境准备好了，运行信息如下</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 容器信息如下：</span>
</span></span><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                            NAMES
</span></span><span style="display:flex;"><span>aa0b29848539   quay.io/coreos/etcd:latest      <span style="color:#d14">&#34;/usr/local/bin/etcd…&#34;</span>   <span style="color:#099">49</span> minutes ago   Up <span style="color:#099">49</span> minutes   0.0.0.0:2379-2380-&gt;2379-2380/tcp                 etcd
</span></span><span style="display:flex;"><span>8cc751e02862   quay.io/minio/minio             <span style="color:#d14">&#34;/usr/bin/docker-ent…&#34;</span>   <span style="color:#099">2</span> hours ago      Up <span style="color:#099">2</span> hours      0.0.0.0:9000-&gt;9000/tcp, 0.0.0.0:9090-&gt;9090/tcp   minio1
</span></span><span style="display:flex;"><span>1ee4158a624a   docker/getting-started:latest   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">12</span> days ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:3000-&gt;3000/tcp, 0.0.0.0:8001-&gt;80/tcp     getting-started-latest
</span></span><span style="display:flex;"><span>46b779b40bb5   nginx:1.22.0                    <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">2</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp         nginx1.22.0
</span></span><span style="display:flex;"><span>83c107ac3c1b   docker-gs-ping:v1.0             <span style="color:#d14">&#34;/docker-gs-ping&#34;</span>        <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8081-&gt;8081/tcp                           go-docker-v1
</span></span><span style="display:flex;"><span>170ce646f5cd   java-docker:v1.0                <span style="color:#d14">&#34;./mvnw spring-boot:…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8080-&gt;8080/tcp                           java-docker-v1
</span></span><span style="display:flex;"><span>439741b1c983   node-docker:v1.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:8000-&gt;8000/tcp                           nodejs-docker-v1
</span></span><span style="display:flex;"><span>77c73cd73550   python-docker:v1.0              <span style="color:#d14">&#34;python3 -m flask ru…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">34</span> minutes   0.0.0.0:5000-&gt;5000/tcp                           python-docker-v1
</span></span><span style="display:flex;"><span>5d3e522b6295   mongo:6.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:27017-&gt;27017/tcp                         mongo6
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:6379-&gt;6379/tcp                           redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                       <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">3</span> weeks ago      Up <span style="color:#099">35</span> minutes   0.0.0.0:3306-&gt;3306/tcp, 33060/tcp                mysql8
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#998;font-style:italic"># 镜像信息如下：</span>
</span></span><span style="display:flex;"><span>docker images
</span></span><span style="display:flex;"><span>REPOSITORY               TAG       IMAGE ID       CREATED        SIZE
</span></span><span style="display:flex;"><span>quay.io/minio/minio      latest    7857bafef273   <span style="color:#099">6</span> days ago     228MB
</span></span><span style="display:flex;"><span>nginx                    1.22.0    2467b41f2ddd   <span style="color:#099">2</span> weeks ago    142MB
</span></span><span style="display:flex;"><span>docker-gs-ping           v1.0      3b7b51a5f6d6   <span style="color:#099">3</span> weeks ago    541MB
</span></span><span style="display:flex;"><span>node-docker              v1.0      2378b1604401   <span style="color:#099">3</span> weeks ago    944MB
</span></span><span style="display:flex;"><span>java-docker              v1.0      04764e57adf2   <span style="color:#099">3</span> weeks ago    559MB
</span></span><span style="display:flex;"><span>python-docker            v1.0      cbc159df0b06   <span style="color:#099">3</span> weeks ago    129MB
</span></span><span style="display:flex;"><span>mongo                    6.0       d34d21a9eb5b   <span style="color:#099">4</span> weeks ago    693MB
</span></span><span style="display:flex;"><span>mysql                    8.0       ff3b5098b416   <span style="color:#099">4</span> weeks ago    447MB
</span></span><span style="display:flex;"><span>redis                    7.0       dc7b40a0b05d   <span style="color:#099">5</span> weeks ago    117MB
</span></span><span style="display:flex;"><span>docker/getting-started   latest    cb90f98fd791   <span style="color:#099">5</span> months ago   28.8MB
</span></span><span style="display:flex;"><span>quay.io/coreos/etcd      latest    61ad63875109   <span style="color:#099">4</span> years ago    39.5MB
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="142-停止容器">14.2 停止容器</h3>
<p>停止脚本如下：</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">46
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">function</span> stop<span style="color:#000;font-weight:bold">()</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#008080">container_name</span><span style="color:#000;font-weight:bold">=</span><span style="color:#008080">$1</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#d14">&#34;</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#34;all&#34;</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># 获取所有状态为 running 的容器 ID</span>
</span></span><span style="display:flex;"><span>        <span style="color:#008080">container_ids</span><span style="color:#000;font-weight:bold">=</span><span style="color:#000;font-weight:bold">$(</span>docker ps -aqf <span style="color:#d14">&#34;status=running&#34;</span><span style="color:#000;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># 如果没有容器处于运行状态，则输出提示信息并退出脚本</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> -z <span style="color:#d14">&#34;</span><span style="color:#d14">${</span><span style="color:#008080">container_ids</span><span style="color:#d14">}</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;No running containers. Done.&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">exit</span> <span style="color:#099">0</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># 循环停止所有处于运行状态的容器</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">for</span> container in <span style="color:#d14">${</span><span style="color:#008080">container_ids</span><span style="color:#d14">}</span>; <span style="color:#000;font-weight:bold">do</span>
</span></span><span style="display:flex;"><span>            docker stop <span style="color:#d14">${</span><span style="color:#008080">container</span><span style="color:#d14">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">done</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>        <span style="color:#008080">container_id</span><span style="color:#000;font-weight:bold">=</span><span style="color:#000;font-weight:bold">$(</span>docker ps -a | grep <span style="color:#d14">&#34;</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">&#34;</span> | grep <span style="color:#d14">&#34;Up&#34;</span> | awk -F<span style="color:#d14">&#34;</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">{</span><span style="color:#d14">&#39;print $1&#39;</span><span style="color:#000;font-weight:bold">}</span><span style="color:#000;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> ! -z <span style="color:#d14">${</span><span style="color:#008080">container_id</span><span style="color:#d14">}</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>            docker stop <span style="color:#d14">${</span><span style="color:#008080">container_id</span><span style="color:#d14">}</span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;stop successful, container name[</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">]&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;container name[</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">] is not exist or stopped.&#34;</span>    
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">function</span> main<span style="color:#000;font-weight:bold">()</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#008080">$#</span> -eq <span style="color:#099">1</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#d14">&#34;</span><span style="color:#008080">$1</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#34;all&#34;</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>            stop <span style="color:#d14">&#34;all&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>            stop <span style="color:#d14">&#34;</span><span style="color:#008080">$1</span><span style="color:#d14">&#34;</span>    
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>        <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;Error Parameter, egg: ./docker-stop-container mysql or ./docker-stop-container all &#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#0086b3">exit</span> <span style="color:#099">1</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>main <span style="color:#008080">$1</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>不需要环境了，可以执行停止脚本暂时停止容器，如下：</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>./docker-stop.sh mysql
</span></span><span style="display:flex;"><span>b055811ce23c
</span></span><span style="display:flex;"><span>stop successful, container name<span style="color:#000;font-weight:bold">[</span>mysql<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>./docker-stop.sh redis
</span></span><span style="display:flex;"><span>e7bbf340c66c
</span></span><span style="display:flex;"><span>stop successful, container name<span style="color:#000;font-weight:bold">[</span>redis<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>./docker-stop.sh mongo
</span></span><span style="display:flex;"><span>5d3e522b6295
</span></span><span style="display:flex;"><span>stop successful, container name<span style="color:#000;font-weight:bold">[</span>mongo<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>./docker-stop.sh docker/getting-started
</span></span><span style="display:flex;"><span>d439c916d2e4
</span></span><span style="display:flex;"><span>stop successful, container name<span style="color:#000;font-weight:bold">[</span>docker/getting-started<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED        STATUS                      PORTS     NAMES
</span></span><span style="display:flex;"><span>46b779b40bb5   nginx:1.22.0             <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">3</span> days ago    Exited <span style="color:#000;font-weight:bold">(</span>0<span style="color:#000;font-weight:bold">)</span> <span style="color:#099">20</span> seconds ago              0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp   nginx1.22.0
</span></span><span style="display:flex;"><span>5d3e522b6295   mongo:6.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">10</span> hours ago   Exited <span style="color:#000;font-weight:bold">(</span>0<span style="color:#000;font-weight:bold">)</span> <span style="color:#099">22</span> seconds ago             mongo6
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">15</span> hours ago   Exited <span style="color:#000;font-weight:bold">(</span>0<span style="color:#000;font-weight:bold">)</span> <span style="color:#099">32</span> seconds ago             redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">18</span> hours ago   Exited <span style="color:#000;font-weight:bold">(</span>0<span style="color:#000;font-weight:bold">)</span> <span style="color:#099">39</span> seconds ago             mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">24</span> hours ago   Exited <span style="color:#000;font-weight:bold">(</span>0<span style="color:#000;font-weight:bold">)</span> <span style="color:#099">5</span> seconds ago              crazy_chatterjee
</span></span></code></pre></td></tr></table>
</div>
</div><h3 id="143-启动脚本如下">14.3 启动脚本如下</h3>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">20
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">21
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">22
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">23
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">24
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">25
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">26
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">27
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">28
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">29
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">30
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">31
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">32
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">33
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">34
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">35
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">36
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">37
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">38
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">39
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">40
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">41
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">42
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">43
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">44
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">45
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">46
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">47
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#000;font-weight:bold">function</span> start<span style="color:#000;font-weight:bold">()</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#008080">container_name</span><span style="color:#000;font-weight:bold">=</span><span style="color:#008080">$1</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#d14">&#34;</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#34;all&#34;</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># 获取所有状态为 exited 的容器 ID</span>
</span></span><span style="display:flex;"><span>        <span style="color:#008080">container_ids</span><span style="color:#000;font-weight:bold">=</span><span style="color:#000;font-weight:bold">$(</span>docker ps -aqf <span style="color:#d14">&#34;status=exited&#34;</span><span style="color:#000;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># 如果没有容器处于停止状态，则输出提示信息并退出脚本</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> -z <span style="color:#d14">&#34;</span><span style="color:#d14">${</span><span style="color:#008080">container_ids</span><span style="color:#d14">}</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;No exited containers. Done.&#34;</span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">exit</span> <span style="color:#099">0</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#998;font-style:italic"># 循环启动所有处于停止状态的容器</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">for</span> container in <span style="color:#d14">${</span><span style="color:#008080">container_ids</span><span style="color:#d14">}</span>; <span style="color:#000;font-weight:bold">do</span>
</span></span><span style="display:flex;"><span>            docker start <span style="color:#d14">${</span><span style="color:#008080">container</span><span style="color:#d14">}</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">done</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>        <span style="color:#008080">container_id</span><span style="color:#000;font-weight:bold">=</span><span style="color:#000;font-weight:bold">$(</span>docker ps -a | grep <span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span> | grep <span style="color:#d14">&#34;Exited&#34;</span> | awk -F<span style="color:#d14">&#34;</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">{</span><span style="color:#d14">&#39;print $1&#39;</span><span style="color:#000;font-weight:bold">}</span><span style="color:#000;font-weight:bold">)</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> ! -z <span style="color:#d14">${</span><span style="color:#008080">container_id</span><span style="color:#d14">}</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>            docker start <span style="color:#d14">${</span><span style="color:#008080">container_id</span><span style="color:#d14">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;start successful, container name[</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">]&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>            <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;container name[</span><span style="color:#d14">${</span><span style="color:#008080">container_name</span><span style="color:#d14">}</span><span style="color:#d14">] is not exist or started.&#34;</span>    
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span> 
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">function</span> main<span style="color:#000;font-weight:bold">()</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#008080">$#</span> -eq <span style="color:#099">1</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">if</span> <span style="color:#000;font-weight:bold">[</span> <span style="color:#d14">&#34;</span><span style="color:#008080">$1</span><span style="color:#d14">&#34;</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#d14">&#34;all&#34;</span> <span style="color:#000;font-weight:bold">]</span>; <span style="color:#000;font-weight:bold">then</span>
</span></span><span style="display:flex;"><span>            start <span style="color:#d14">&#34;all&#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>            start <span style="color:#d14">&#34;</span><span style="color:#008080">$1</span><span style="color:#d14">&#34;</span>    
</span></span><span style="display:flex;"><span>        <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">else</span>
</span></span><span style="display:flex;"><span>        <span style="color:#0086b3">echo</span> <span style="color:#d14">&#34;Error Parameter, egg: ./docker-start-container mysql or ./docker-start-container all &#34;</span>
</span></span><span style="display:flex;"><span>        <span style="color:#0086b3">exit</span> <span style="color:#099">1</span>
</span></span><span style="display:flex;"><span>    <span style="color:#000;font-weight:bold">fi</span>
</span></span><span style="display:flex;"><span><span style="color:#000;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>main <span style="color:#008080">$1</span>
</span></span></code></pre></td></tr></table>
</div>
</div><p>需要环境了，可以执行启动脚本再次启动容器，如下：</p>
<div class="highlight"><div style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">
<table style="border-spacing:0;padding:0;margin:0;border:0;"><tr><td style="vertical-align:top;padding:0;margin:0;border:0;">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 1
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 2
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 3
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 4
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 5
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 6
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 7
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 8
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f"> 9
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">10
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">11
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">12
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">13
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">14
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">15
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">16
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">17
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">18
</span><span style="white-space:pre;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#7f7f7f">19
</span></code></pre></td>
<td style="vertical-align:top;padding:0;margin:0;border:0;;width:100%">
<pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>./docker-start-container.sh mongo
</span></span><span style="display:flex;"><span>5d3e522b6295
</span></span><span style="display:flex;"><span>start successful, container name<span style="color:#000;font-weight:bold">[</span>mongo<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>./docker-start-container.sh redis
</span></span><span style="display:flex;"><span>e7bbf340c66c
</span></span><span style="display:flex;"><span>start successful, container name<span style="color:#000;font-weight:bold">[</span>redis<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>./docker-start-container.sh mysql
</span></span><span style="display:flex;"><span>b055811ce23c
</span></span><span style="display:flex;"><span>start successful, container name<span style="color:#000;font-weight:bold">[</span>mysql<span style="color:#000;font-weight:bold">]</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>docker ps -a
</span></span><span style="display:flex;"><span>CONTAINER ID   IMAGE                    COMMAND                  CREATED        STATUS                         PORTS                               NAMES
</span></span><span style="display:flex;"><span>46b779b40bb5   nginx:1.22.0             <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">3</span> days ago    Up <span style="color:#099">48</span> minutes              0.0.0.0:80-&gt;80/tcp, 0.0.0.0:443-&gt;443/tcp   nginx1.22.0
</span></span><span style="display:flex;"><span>5d3e522b6295   mongo:6.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">11</span> hours ago   Up <span style="color:#099">8</span> seconds                   0.0.0.0:27017-&gt;27017/tcp            mongo6
</span></span><span style="display:flex;"><span>e7bbf340c66c   redis:7.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">15</span> hours ago   Up <span style="color:#099">6</span> seconds                   0.0.0.0:6379-&gt;6379/tcp              redis7
</span></span><span style="display:flex;"><span>b055811ce23c   mysql:8.0                <span style="color:#d14">&#34;docker-entrypoint.s…&#34;</span>   <span style="color:#099">19</span> hours ago   Up <span style="color:#099">2</span> seconds                   0.0.0.0:3306-&gt;3306/tcp, 33060/tcp   mysql8
</span></span><span style="display:flex;"><span>d439c916d2e4   docker/getting-started   <span style="color:#d14">&#34;/docker-entrypoint.…&#34;</span>   <span style="color:#099">24</span> hours ago   Up <span style="color:#099">5</span> minutes                   0.0.0.0:80-&gt;80/tcp                  crazy_chatterjee
</span></span></code></pre></td></tr></table>
</div>
</div><p>后续有其他工具补充再继续完善。。。</p>

        </div>

        
<div class="post-archive">
    <ul class="post-copyright">
        <li><strong>原文作者：</strong><a rel="author" href="https://anttu.gitee.io/">Anttu</a></li>
        <li style="word-break:break-all"><strong>原文链接：</strong><a href="https://anttu.gitee.io/post/2022-09-06-mac_docker_dev/">https://anttu.gitee.io/post/2022-09-06-mac_docker_dev/</a></li>
        <li><strong>版权声明：</strong>本作品采用<a rel="license" href="https://creativecommons.org/licenses/by-nc-nd/4.0/">知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议</a>进行许可，非商业转载请注明出处（作者，原文链接），商业转载请联系作者获得授权。</li>
    </ul>
</div>
<br/>



        

<div class="post-archive">
    <h2>See Also</h2>
    <ul class="listing">
        
        <li><a href="/post/2022-08-11-arthas/">转载-arthas常见用法</a></li>
        
        <li><a href="/post/2022-07-11-id_discuss/">几种id浅谈</a></li>
        
        <li><a href="/post/2022-06-17-python_req/">python打包-只依赖自己项目引用的module</a></li>
        
        <li><a href="/post/2022-05-25-pen_testing/">渗透测试的部分资料</a></li>
        
        <li><a href="/post/2022-04-22-shell_question/">转载-shell 13问</a></li>
        
    </ul>
</div>


        <div class="post-meta meta-tags">
            
            没有标签
            
        </div>
    </article>
    
    

    
    
    <div class="post bg-white">
      <script src="https://utteranc.es/client.js"
            repo= "anTtutu/anTtutu.github.io"
            issue-term="pathname"
            theme="github-light"
            crossorigin="anonymous"
            async>
      </script>
    </div>
    
    
    
</div>

                    <footer id="footer">
    <div>
        &copy; 2025 <a href="https://anttu.gitee.io/">Anttu&#39;s Blog By Anttu</a>
        
    </div>
    <br />
    <div>
        <div class="github-badge">
            <a href="https://gohugo.io/" target="_black" rel="nofollow"><span class="badge-subject">Powered by</span><span class="badge-value bg-blue">Hugo</span></a>
        </div>
        
        <div class="github-badge">
            <a href="https://github.com/flysnow-org/maupassant-hugo" target="_black"><span class="badge-subject">Theme</span><span class="badge-value bg-yellowgreen">Maupassant</span></a>
        </div>
    </div>
</footer>


    
    
    <script type="text/javascript">
        window.MathJax = {
            tex2jax: {
                inlineMath: [['$', '$']],
                processEscapes: true
                }
            };
    </script>
    <script src='//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML' async></script>

<a id="rocket" href="#top"></a>
<script type="text/javascript" src='/js/totop.js?v=0.0.0' async=""></script>
<style type="text/css">
div.highlight {
    position: relative;
    margin: 1em 0px;
}

.copy-code {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(78, 78, 78, 0.8);
    border-radius: var(--radius);
    padding: 0 5px;
    font: inherit;
    user-select: none;
    cursor: pointer;
    border: 0;
    --radius: 8px;
}

div.highlight:hover .copy-code,pre:hover .copy-code {
    display: block;
}

</style>
<script>
    document.querySelectorAll('pre > code').forEach((codeblock) => {
        const container = codeblock.parentNode.parentNode;

        const copybutton = document.createElement('button');
        copybutton.classList.add('copy-code');
        copybutton.innerHTML = 'copy';

        function copyingDone() {
            copybutton.innerHTML = 'copied!';
            setTimeout(() => {
                copybutton.innerHTML = 'copy';
            }, 2000);
        }

        copybutton.addEventListener('click', (cb) => {
            if ('clipboard' in navigator) {
                navigator.clipboard.writeText(codeblock.textContent);
                copyingDone();
                return;
            }

            const range = document.createRange();
            range.selectNodeContents(codeblock);
            const selection = window.getSelection();
            selection.removeAllRanges();
            selection.addRange(range);
            try {
                document.execCommand('copy');
                copyingDone();
            } catch (e) { };
            selection.removeRange(range);
        });

        if (container.classList.contains("highlight")) {
            container.appendChild(copybutton);
        } else if (container.parentNode.firstChild == container) {
            
        } else if (codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.nodeName == "TABLE") {
            
            codeblock.parentNode.parentNode.parentNode.parentNode.parentNode.appendChild(copybutton);
        } else {
            
            codeblock.parentNode.appendChild(copybutton);
        }
    });
</script>


    <script type="text/javascript" src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" async></script>




    <script src='/js/asciinema-player.js'></script>

                </div>

                <div id="secondary">
    <section class="widget">
        <form id="search" action='https://anttu.gitee.io/search' method="get" accept-charset="utf-8" target="_blank" _lpchecked="1">
      
      <input type="text" name="q" maxlength="20" placeholder="Search">
      <input type="hidden" name="sitesearch" value="https://anttu.gitee.io/">
      <button type="submit" class="submit icon-search"></button>
</form>
    </section>
    
    <section class="widget">
        <h3 class="widget-title">最近文章</h3>
<ul class="widget-list">
    
    <li>
        <a href="https://anttu.gitee.io/post/2025-02-13-mvnd/" title="mvnd结合idea使用" target="_blank">mvnd结合idea使用</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2024-04-15-postgresql/" title="postgresql数据库常用记录" target="_blank">postgresql数据库常用记录</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2023-06-16-miner_virus_5/" title="挖矿病毒5-私有云机房挖矿病毒定位" target="_blank">挖矿病毒5-私有云机房挖矿病毒定位</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2022-12-26-covid-19/" title="羊了" target="_blank">羊了</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2022-12-19-git_delete_history/" title="git删除历史提交记录" target="_blank">git删除历史提交记录</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2022-11-28-python_muilt_version/" title="python多版本管理工具" target="_blank">python多版本管理工具</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2022-11-22-springboot_start_failed/" title="springboot常见兼容性错误" target="_blank">springboot常见兼容性错误</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2022-11-14-docker_port/" title="docker修改运行的容器端口" target="_blank">docker修改运行的容器端口</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2022-11-10-go_muilt_version/" title="go多版本管理工具" target="_blank">go多版本管理工具</a>
    </li>
    
    <li>
        <a href="https://anttu.gitee.io/post/2022-10-27-jenkins_reset/" title="jenkins的admin密码忘记了如何重置" target="_blank">jenkins的admin密码忘记了如何重置</a>
    </li>
    
</ul>
    </section>

    

    <section class="widget">
        <h3 class="widget-title"><a href='/categories/'>分类</a></h3>
<ul class="widget-list">
    
    <li><a href="https://anttu.gitee.io/categories/about/">about (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/android/">android (2)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/app/">app (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/aria2/">aria2 (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/arm64/">arm64 (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/arthas/">arthas (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/awr/">awr (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/backend_execute/">backend_execute (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/backup/">backup (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/blog/">blog (3)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/bug/">bug (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/build/">build (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/cache/">cache (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/caffeine/">caffeine (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/captcha/">captcha (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/check/">check (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/clean/">clean (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/cli/">cli (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/cluster/">cluster (4)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/covid-19/">covid-19 (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/cve/">cve (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/cygwin/">cygwin (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/dataguard/">dataguard (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/db/">db (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/deepfacelab/">deepfacelab (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/devops/">devops (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/docker/">docker (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/dockerfile/">dockerfile (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/dos/">dos (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/dump/">dump (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/eclipse/">eclipse (2)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/explain/">explain (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/faker/">faker (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/gcc/">gcc (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/git/">git (2)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/gitment/">gitment (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/gitpages/">gitpages (2)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/go/">go (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/h2/">h2 (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/h5/">h5 (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/ha/">ha (4)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/http/">http (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/hugo/">hugo (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/id/">id (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/idea/">idea (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/java/">java (24)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/jekyll/">jekyll (2)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/jenkins/">jenkins (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/jrebel/">jrebel (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/js/">js (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/jsr/">jsr (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/jvm/">jvm (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/kafka/">kafka (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/kali/">kali (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/kenlm/">kenlm (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/linux/">linux (22)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/log/">log (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/log4j/">log4j (2)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/lombok/">lombok (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/mac/">mac (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/matplotlib/">matplotlib (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/maven/">maven (3)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/mine/">mine (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/mongodb/">mongodb (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/mvnd/">mvnd (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/mysql/">mysql (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/nginx/">nginx (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/nmap/">nmap (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/oom/">oom (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/oracle/">oracle (3)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/orangePi/">orangePi (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/package/">package (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/pandas/">pandas (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/pg/">pg (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/port/">port (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/postgresql/">postgresql (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/python/">python (8)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/rec/">rec (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/redis/">redis (3)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/regexp/">regexp (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/safe/">safe (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/sdk/">sdk (3)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/shell/">shell (3)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/split/">split (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/springboot/">springboot (4)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/springcloud/">springcloud (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/sqlmap/">sqlmap (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/ssd/">ssd (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/tcp/">tcp (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/termux/">termux (2)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/test/">test (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/testing/">testing (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/union_id/">union_id (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/vcs/">vcs (7)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/virus/">virus (5)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/vxvm/">vxvm (3)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/win10/">win10 (6)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/xrebel/">xrebel (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/ynote/">ynote (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/zk/">zk (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/zookeeper/">zookeeper (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/%E5%89%8D%E7%AB%AF/">前端 (1)</a></li>
    
    <li><a href="https://anttu.gitee.io/categories/%E5%AE%B9%E7%81%BE/">容灾 (1)</a></li>
    
</ul>
    </section>

    <section class="widget">
        <h3 class="widget-title"><a href='/tags/'>标签</a></h3>
<div class="tagcloud">
    
    <a href="https://anttu.gitee.io/tags/about/">about</a>
    
    <a href="https://anttu.gitee.io/tags/android/">android</a>
    
    <a href="https://anttu.gitee.io/tags/app/">app</a>
    
    <a href="https://anttu.gitee.io/tags/aria2/">aria2</a>
    
    <a href="https://anttu.gitee.io/tags/arm64/">arm64</a>
    
    <a href="https://anttu.gitee.io/tags/awr/">awr</a>
    
    <a href="https://anttu.gitee.io/tags/backup/">backup</a>
    
    <a href="https://anttu.gitee.io/tags/blog/">blog</a>
    
    <a href="https://anttu.gitee.io/tags/bug/">bug</a>
    
    <a href="https://anttu.gitee.io/tags/build/">build</a>
    
    <a href="https://anttu.gitee.io/tags/captcha/">captcha</a>
    
    <a href="https://anttu.gitee.io/tags/check/">check</a>
    
    <a href="https://anttu.gitee.io/tags/cluster/">cluster</a>
    
    <a href="https://anttu.gitee.io/tags/cygwin/">cygwin</a>
    
    <a href="https://anttu.gitee.io/tags/dataguard/">dataguard</a>
    
    <a href="https://anttu.gitee.io/tags/deepfacelab/">deepfacelab</a>
    
    <a href="https://anttu.gitee.io/tags/dos/">dos</a>
    
    <a href="https://anttu.gitee.io/tags/eclipse/">eclipse</a>
    
    <a href="https://anttu.gitee.io/tags/explain/">explain</a>
    
    <a href="https://anttu.gitee.io/tags/gcc/">gcc</a>
    
    <a href="https://anttu.gitee.io/tags/gitment/">gitment</a>
    
    <a href="https://anttu.gitee.io/tags/gitpages/">gitpages</a>
    
    <a href="https://anttu.gitee.io/tags/go/">go</a>
    
    <a href="https://anttu.gitee.io/tags/h2/">h2</a>
    
    <a href="https://anttu.gitee.io/tags/h5/">h5</a>
    
    <a href="https://anttu.gitee.io/tags/ha/">ha</a>
    
    <a href="https://anttu.gitee.io/tags/http/">http</a>
    
    <a href="https://anttu.gitee.io/tags/hugo/">hugo</a>
    
    <a href="https://anttu.gitee.io/tags/java/">java</a>
    
    <a href="https://anttu.gitee.io/tags/jekyll/">jekyll</a>
    
    <a href="https://anttu.gitee.io/tags/jrebel/">jrebel</a>
    
    <a href="https://anttu.gitee.io/tags/js/">js</a>
    
    <a href="https://anttu.gitee.io/tags/jsr/">jsr</a>
    
    <a href="https://anttu.gitee.io/tags/kafka/">kafka</a>
    
    <a href="https://anttu.gitee.io/tags/kali/">kali</a>
    
    <a href="https://anttu.gitee.io/tags/kenlm/">kenlm</a>
    
    <a href="https://anttu.gitee.io/tags/linux/">linux</a>
    
    <a href="https://anttu.gitee.io/tags/log4j/">log4j</a>
    
    <a href="https://anttu.gitee.io/tags/mac/">mac</a>
    
    <a href="https://anttu.gitee.io/tags/mine/">mine</a>
    
    <a href="https://anttu.gitee.io/tags/mongodb/">mongodb</a>
    
    <a href="https://anttu.gitee.io/tags/mysql/">mysql</a>
    
    <a href="https://anttu.gitee.io/tags/nginx/">nginx</a>
    
    <a href="https://anttu.gitee.io/tags/oom/">oom</a>
    
    <a href="https://anttu.gitee.io/tags/oracle/">oracle</a>
    
    <a href="https://anttu.gitee.io/tags/orangePi/">orangePi</a>
    
    <a href="https://anttu.gitee.io/tags/python/">python</a>
    
    <a href="https://anttu.gitee.io/tags/rec/">rec</a>
    
    <a href="https://anttu.gitee.io/tags/redis/">redis</a>
    
    <a href="https://anttu.gitee.io/tags/safe/">safe</a>
    
    <a href="https://anttu.gitee.io/tags/shell/">shell</a>
    
    <a href="https://anttu.gitee.io/tags/springboot/">springboot</a>
    
    <a href="https://anttu.gitee.io/tags/sqlmap/">sqlmap</a>
    
    <a href="https://anttu.gitee.io/tags/ssd/">ssd</a>
    
    <a href="https://anttu.gitee.io/tags/tcp/">tcp</a>
    
    <a href="https://anttu.gitee.io/tags/termux/">termux</a>
    
    <a href="https://anttu.gitee.io/tags/union_id/">union_id</a>
    
    <a href="https://anttu.gitee.io/tags/vcs/">vcs</a>
    
    <a href="https://anttu.gitee.io/tags/virus/">virus</a>
    
    <a href="https://anttu.gitee.io/tags/vxvm/">vxvm</a>
    
    <a href="https://anttu.gitee.io/tags/win10/">win10</a>
    
    <a href="https://anttu.gitee.io/tags/xrebel/">xrebel</a>
    
    <a href="https://anttu.gitee.io/tags/ynote/">ynote</a>
    
    <a href="https://anttu.gitee.io/tags/zk/">zk</a>
    
    <a href="https://anttu.gitee.io/tags/zookeeper/">zookeeper</a>
    
    <a href="https://anttu.gitee.io/tags/%E5%AE%B9%E7%81%BE/">容灾</a>
    
</div>
    </section>

    

    <section class="widget">
        <h3 class="widget-title">其它</h3>
        <ul class="widget-list">
            <li><a href="https://anttu.gitee.io/index.xml">文章 RSS</a></li>
        </ul>
    </section>
</div>
            </div>
        </div>
    </div>
</body>

</html>